Skip to main content

AgentAnswer

Trait AgentAnswer 

Source
pub trait AgentAnswer { }
Expand description

A type that holds no text written by an agent, except as AgentText.

Required on the T of .output::<T>() for WorkflowContext::agent and on AgentRole::Output. Derive it, see the module documentation. Implemented for numbers, bool, char, (), AgentText, Uuid, Decimal, and for Option, Vec, Box, arrays, sets and maps of such types; deliberately not for String, str, Cow<str>, Box<str> nor serde_json::Value.

§Examples

use ironflow_engine::config::{AgentAnswer, AgentText};

#[derive(AgentAnswer)]
struct Triage {
    test: AgentText,
    flaky: bool,
}

fn assert_answer<T: AgentAnswer>() {}
assert_answer::<Triage>();
assert_answer::<Vec<Option<AgentText>>>();

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AgentAnswer for ()

Source§

impl AgentAnswer for Decimal

Source§

impl AgentAnswer for Uuid

Source§

impl AgentAnswer for bool

Source§

impl AgentAnswer for char

Source§

impl AgentAnswer for f32

Source§

impl AgentAnswer for f64

Source§

impl AgentAnswer for i8

Source§

impl AgentAnswer for i16

Source§

impl AgentAnswer for i32

Source§

impl AgentAnswer for i64

Source§

impl AgentAnswer for i128

Source§

impl AgentAnswer for isize

Source§

impl AgentAnswer for u8

Source§

impl AgentAnswer for u16

Source§

impl AgentAnswer for u32

Source§

impl AgentAnswer for u64

Source§

impl AgentAnswer for u128

Source§

impl AgentAnswer for usize

Source§

impl<K: AgentAnswer, V: AgentAnswer, S> AgentAnswer for HashMap<K, V, S>

Source§

impl<K: AgentAnswer, V: AgentAnswer> AgentAnswer for BTreeMap<K, V>

Source§

impl<T: AgentAnswer, S> AgentAnswer for HashSet<T, S>

Source§

impl<T: AgentAnswer, const N: usize> AgentAnswer for [T; N]

Source§

impl<T: AgentAnswer> AgentAnswer for BTreeSet<T>

Source§

impl<T: AgentAnswer> AgentAnswer for Box<T>

Source§

impl<T: AgentAnswer> AgentAnswer for Option<T>

Source§

impl<T: AgentAnswer> AgentAnswer for Vec<T>

Implementors§