pub struct Subtask {
pub id: String,
pub description: String,
pub input_state: Value,
pub expected_output_format: Option<OutputFormat>,
pub depends_on: Vec<String>,
pub complexity_estimate: f32,
pub instructions: Option<String>,
}Expand description
A minimal subtask that can be executed by a microagent
Fields§
§id: StringUnique identifier for this subtask
description: StringHuman-readable description of what this subtask does
input_state: ValueInput state/context for this subtask
expected_output_format: Option<OutputFormat>Expected output format for validation
depends_on: Vec<String>IDs of subtasks this one depends on
complexity_estimate: f32Complexity estimate (0.0-1.0) for cost estimation
instructions: Option<String>Optional specific instructions for this subtask
Implementations§
Source§impl Subtask
impl Subtask
Sourcepub fn atomic(description: impl Into<String>) -> Self
pub fn atomic(description: impl Into<String>) -> Self
Create an atomic (non-decomposable) subtask
Sourcepub fn new(
id: impl Into<String>,
description: impl Into<String>,
input_state: Value,
) -> Self
pub fn new( id: impl Into<String>, description: impl Into<String>, input_state: Value, ) -> Self
Create a subtask with full configuration
Sourcepub fn with_format(self, format: OutputFormat) -> Self
pub fn with_format(self, format: OutputFormat) -> Self
Set expected output format
Sourcepub fn depends_on(self, deps: Vec<String>) -> Self
pub fn depends_on(self, deps: Vec<String>) -> Self
Add dependencies
Sourcepub fn with_complexity(self, complexity: f32) -> Self
pub fn with_complexity(self, complexity: f32) -> Self
Set complexity estimate
Sourcepub fn with_instructions(self, instructions: impl Into<String>) -> Self
pub fn with_instructions(self, instructions: impl Into<String>) -> Self
Set specific instructions
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subtask
impl<'de> Deserialize<'de> for Subtask
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
Auto Trait Implementations§
impl Freeze for Subtask
impl RefUnwindSafe for Subtask
impl Send for Subtask
impl Sync for Subtask
impl Unpin for Subtask
impl UnsafeUnpin for Subtask
impl UnwindSafe for Subtask
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