pub struct AgentSpec { /* private fields */ }Expand description
The spec for an agent node: a full agent loop referenced by content hash.
Implementations§
Source§impl AgentSpec
impl AgentSpec
Sourcepub fn new(id: impl Into<String>, agent_hash: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, agent_hash: impl Into<String>) -> Self
Starts an agent spec with its two required fields: the node id and the
sha256:<64 hex> agent hash. The hash form is checked by
[crate::validate], not here.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Sets a short display label for this node. Bounds (a 64-character cap,
not empty or all whitespace) are checked by [crate::validate], not
here; see crate::document’s “The optional node display name”
section for why this field, unlike an agent’s own name, is part of
the graph’s content hash.
Sourcepub fn input_schema(self, schema: Value) -> Self
pub fn input_schema(self, schema: Value) -> Self
Declares the JSON Schema for the payload this agent consumes.
Sourcepub fn output_schema(self, schema: Value) -> Self
pub fn output_schema(self, schema: Value) -> Self
Declares the JSON Schema for the payload this agent produces.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AgentSpec
impl RefUnwindSafe for AgentSpec
impl Send for AgentSpec
impl Sync for AgentSpec
impl Unpin for AgentSpec
impl UnsafeUnpin for AgentSpec
impl UnwindSafe for AgentSpec
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