pub struct ToolCallResultEvent {
pub base: BaseEvent,
pub message_id: MessageId,
pub tool_call_id: ToolCallId,
pub content: ToolContent,
pub role: Option<ToolResultRole>,
pub subagent_run_id: Option<SubagentRunId>,
}Expand description
The result of a tool call, as a message appended to the thread.
Fields§
§base: BaseEventTimestamp and raw provider event.
message_id: MessageIdId of the tool message carrying the result.
tool_call_id: ToolCallIdThe call this result answers.
content: ToolContentPlain text or ordered multimodal parts returned by the tool.
role: Option<ToolResultRole>Always "tool" when present.
subagent_run_id: Option<SubagentRunId>The subagent that executed the call; absent means the parent agent.
A JSON null is rejected — see crate::event::subagent. Attributed
independently of the call it answers, on purpose: a frontend-executed
tool, or a supervisor running a call on a subagent’s behalf, produces
a result whose owner is not the caller.
Implementations§
Source§impl ToolCallResultEvent
impl ToolCallResultEvent
Sourcepub fn new(
message_id: impl Into<MessageId>,
tool_call_id: impl Into<ToolCallId>,
content: impl Into<ToolContent>,
) -> Self
pub fn new( message_id: impl Into<MessageId>, tool_call_id: impl Into<ToolCallId>, content: impl Into<ToolContent>, ) -> Self
Reports the result of a call.
Trait Implementations§
Source§impl Clone for ToolCallResultEvent
impl Clone for ToolCallResultEvent
Source§impl ComposeSchema for ToolCallResultEvent
impl ComposeSchema for ToolCallResultEvent
Source§impl Debug for ToolCallResultEvent
impl Debug for ToolCallResultEvent
Source§impl Default for ToolCallResultEvent
impl Default for ToolCallResultEvent
Source§impl<'de> Deserialize<'de> for ToolCallResultEvent
impl<'de> Deserialize<'de> for ToolCallResultEvent
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 From<ToolCallResultEvent> for Event
impl From<ToolCallResultEvent> for Event
Source§fn from(payload: ToolCallResultEvent) -> Self
fn from(payload: ToolCallResultEvent) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for ToolCallResultEvent
impl JsonSchema for ToolCallResultEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ToolCallResultEvent
impl PartialEq for ToolCallResultEvent
Source§impl Serialize for ToolCallResultEvent
impl Serialize for ToolCallResultEvent
impl StructuralPartialEq for ToolCallResultEvent
Auto Trait Implementations§
impl Freeze for ToolCallResultEvent
impl RefUnwindSafe for ToolCallResultEvent
impl Send for ToolCallResultEvent
impl Sync for ToolCallResultEvent
impl Unpin for ToolCallResultEvent
impl UnsafeUnpin for ToolCallResultEvent
impl UnwindSafe for ToolCallResultEvent
Blanket Implementations§
impl<T> AgentState for T
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