pub struct SubagentStartedEvent {
pub base: BaseEvent,
pub subagent_run_id: SubagentRunId,
pub name: String,
pub description: Option<String>,
pub parent_subagent_run_id: Option<SubagentRunId>,
pub parent_tool_call_id: Option<ToolCallId>,
pub parent_message_id: Option<MessageId>,
}Expand description
Announces a subagent invocation and gives it a name a UI can display.
On this event, unlike the attributable ones, subagent_run_id is required:
it is the subject, not a tag.
Fields§
§base: BaseEventTimestamp, raw provider event and metadata.
subagent_run_id: SubagentRunIdOpaque id for this invocation. See the module docs for what it is not.
name: StringThe subagent’s declared type or name, for display — the reusable half.
description: Option<String>Human-readable description.
parent_subagent_run_id: Option<SubagentRunId>The enclosing subagent, when subagents nest. May name one that has already finished — a parent legitimately finishes before its child.
parent_tool_call_id: Option<ToolCallId>The tool call that spawned this subagent, for the agents-as-tools
pattern: lets a consumer render the subagent inside the tool-call card
without inspecting rawEvent.
parent_message_id: Option<MessageId>The message that held that tool call.
Implementations§
Source§impl SubagentStartedEvent
impl SubagentStartedEvent
Sourcepub fn new(
subagent_run_id: impl Into<SubagentRunId>,
name: impl Into<String>,
) -> Self
pub fn new( subagent_run_id: impl Into<SubagentRunId>, name: impl Into<String>, ) -> Self
Announces a subagent invocation.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description.
Sourcepub fn with_parent_subagent(self, parent: impl Into<SubagentRunId>) -> Self
pub fn with_parent_subagent(self, parent: impl Into<SubagentRunId>) -> Self
Names the enclosing subagent.
Sourcepub fn with_parent_tool_call(self, tool_call_id: impl Into<ToolCallId>) -> Self
pub fn with_parent_tool_call(self, tool_call_id: impl Into<ToolCallId>) -> Self
Links the subagent to the tool call that spawned it — the agents-as-tools pattern, where a UI draws the subagent inside the call’s card.
Sourcepub fn with_parent_message(self, message_id: impl Into<MessageId>) -> Self
pub fn with_parent_message(self, message_id: impl Into<MessageId>) -> Self
Links the subagent to the assistant message that held the spawning tool call, when the call sat in one.
Trait Implementations§
Source§impl Clone for SubagentStartedEvent
impl Clone for SubagentStartedEvent
Source§fn clone(&self) -> SubagentStartedEvent
fn clone(&self) -> SubagentStartedEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ComposeSchema for SubagentStartedEvent
impl ComposeSchema for SubagentStartedEvent
Source§impl Debug for SubagentStartedEvent
impl Debug for SubagentStartedEvent
Source§impl Default for SubagentStartedEvent
impl Default for SubagentStartedEvent
Source§fn default() -> SubagentStartedEvent
fn default() -> SubagentStartedEvent
Source§impl<'de> Deserialize<'de> for SubagentStartedEvent
impl<'de> Deserialize<'de> for SubagentStartedEvent
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>,
Source§impl From<SubagentStartedEvent> for Event
impl From<SubagentStartedEvent> for Event
Source§fn from(payload: SubagentStartedEvent) -> Self
fn from(payload: SubagentStartedEvent) -> Self
Source§impl JsonSchema for SubagentStartedEvent
impl JsonSchema for SubagentStartedEvent
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 PartialEq for SubagentStartedEvent
impl PartialEq for SubagentStartedEvent
Source§fn eq(&self, other: &SubagentStartedEvent) -> bool
fn eq(&self, other: &SubagentStartedEvent) -> bool
self and other values to be equal, and is used by ==.