pub struct ToonWorkflowConfig {
pub name: String,
pub entry_agent: String,
pub fallback_agent: Option<String>,
pub max_depth: u8,
pub max_iterations: u8,
pub parallel_subagents: bool,
}Expand description
Configuration for a workflow loaded from TOON files
Workflows define how agents work together to handle complex requests. They specify entry points, fallbacks, and iteration limits.
Fields§
§name: StringUnique identifier for the workflow
entry_agent: StringThe agent that first receives requests
fallback_agent: Option<String>Agent to use if routing/entry fails
max_depth: u8Maximum depth for recursive agent calls
max_iterations: u8Maximum total iterations across all agents
parallel_subagents: boolWhether to run subagents in parallel when possible
Implementations§
Source§impl ToonWorkflowConfig
impl ToonWorkflowConfig
Sourcepub fn new(name: impl Into<String>, entry_agent: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, entry_agent: impl Into<String>) -> Self
Create a new workflow config with required fields
Sourcepub fn to_toon(&self) -> Result<String, ToonConfigError>
pub fn to_toon(&self) -> Result<String, ToonConfigError>
Encode this config to TOON format
Sourcepub fn from_toon(toon: &str) -> Result<Self, ToonConfigError>
pub fn from_toon(toon: &str) -> Result<Self, ToonConfigError>
Parse a workflow config from TOON format
Trait Implementations§
Source§impl Clone for ToonWorkflowConfig
impl Clone for ToonWorkflowConfig
Source§fn clone(&self) -> ToonWorkflowConfig
fn clone(&self) -> ToonWorkflowConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToonWorkflowConfig
impl Debug for ToonWorkflowConfig
Source§impl<'de> Deserialize<'de> for ToonWorkflowConfig
impl<'de> Deserialize<'de> for ToonWorkflowConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl HasName for ToonWorkflowConfig
impl HasName for ToonWorkflowConfig
Source§impl PartialEq for ToonWorkflowConfig
impl PartialEq for ToonWorkflowConfig
Source§impl Serialize for ToonWorkflowConfig
impl Serialize for ToonWorkflowConfig
impl StructuralPartialEq for ToonWorkflowConfig
Auto Trait Implementations§
impl Freeze for ToonWorkflowConfig
impl RefUnwindSafe for ToonWorkflowConfig
impl Send for ToonWorkflowConfig
impl Sync for ToonWorkflowConfig
impl Unpin for ToonWorkflowConfig
impl UnsafeUnpin for ToonWorkflowConfig
impl UnwindSafe for ToonWorkflowConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more