pub struct AgentDef {
pub name: String,
pub kind: AgentKind,
pub spec: Value,
pub profile: Option<AgentProfile>,
pub meta: Option<AgentMeta>,
}Expand description
Maps an agent name to a Worker IMPL kind and its configuration. Referenced from flow.ir
Step.ref by name.
§Design
AgentDef.kind directly expresses the Worker IMPL axis (= not the old Spawner axis).
Dispatching to a host Spawner adapter (InProcSpawner / ProcessSpawner /
OperatorSpawner) is done by an internal Resolver on the compiler side. The design goal
is “do not make the caller aware of which Spawner hosts the Worker IMPL”; the caller
(Blueprint author) sees only the WorkerIMPL viewpoint.
A Spawner-axis hint (= “which adapter would you prefer running this Worker on”, as a
priority list) will be added via a future spawner_hint: Vec<Spawner> field as a carry.
The current internal Resolver is a fixed 1:1 mapping, so the field is unnecessary today.
Fields§
§name: StringAgent name (= referenced from flow.ir Step.ref).
kind: AgentKindWorker IMPL kind (= see AgentKind).
spec: ValueFree-form schema per kind. Interpreted by the SpawnerFactory.
profile: Option<AgentProfile>Agent persona information (system_prompt / model / tools, etc.). Orthogonal to the
backend kind and is a first-class field. Expected to be populated by
agent_md_loader from the frontmatter + body of an agent.md. None = an agent
without a profile (= backend built solely from spec).
meta: Option<AgentMeta>Agent-level metadata (description / version / tags).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AgentDef
impl<'de> Deserialize<'de> for AgentDef
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AgentDef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for AgentDef
impl JsonSchema for AgentDef
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for AgentDef
impl Serialize for AgentDef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for AgentDef
Auto Trait Implementations§
impl Freeze for AgentDef
impl RefUnwindSafe for AgentDef
impl Send for AgentDef
impl Sync for AgentDef
impl Unpin for AgentDef
impl UnsafeUnpin for AgentDef
impl UnwindSafe for AgentDef
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
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>
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>
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