pub enum ToolEvent {
Show 14 variants
Call {
request: ToolCallRequest,
},
CallUpdate {
tool_call_id: String,
chunk: String,
},
ExecutionStarted {
tool_id: String,
tool_name: String,
},
Progress {
request: ToolCallRequest,
progress: f64,
total: Option<f64>,
message: Option<String>,
},
SubAgentProgress {
request: ToolCallRequest,
payload: Box<SubAgentProgressPayload>,
},
DisplayUpdate {
request: ToolCallRequest,
meta: ToolResultMeta,
},
TaskCreated {
request: ToolCallRequest,
task_id: String,
status_message: Option<String>,
},
TaskStatus {
request: ToolCallRequest,
task_id: String,
status: String,
status_message: Option<String>,
},
TaskCompleted {
request: ToolCallRequest,
task_id: String,
result: ToolCallResult,
result_meta: Option<ToolResultMeta>,
},
TaskFailed {
request: ToolCallRequest,
task_id: String,
error: ToolCallError,
},
TaskCancelled {
request: ToolCallRequest,
task_id: String,
},
Result {
result: ToolCallResult,
result_meta: Option<ToolResultMeta>,
},
Error {
error: ToolCallError,
},
DefinitionsUpdated {
tools: Vec<ToolDefinition>,
},
}Expand description
Tool call lifecycle events.
Variants§
Call
The LLM requested a tool call; arguments may still be streaming.
Fields
§
request: ToolCallRequestCallUpdate
A chunk of streamed tool call arguments.
ExecutionStarted
The tool began executing.
Progress
Progress reported by an executing tool.
SubAgentProgress
Progress from a sub-agent spawned by this tool call, carrying the child’s own event.
DisplayUpdate
An executing tool refreshed how it should be displayed.
TaskCreated
A background task was created by a tool call response.
TaskStatus
The background task reported a new status.
TaskCompleted
The background task completed successfully.
TaskFailed
The background task failed.
TaskCancelled
The background task was cancelled.
Result
The tool completed successfully.
Error
The tool failed.
Fields
§
error: ToolCallErrorDefinitionsUpdated
The set of available tool definitions changed.
Fields
§
tools: Vec<ToolDefinition>Implementations§
Source§impl ToolEvent
impl ToolEvent
Sourcepub fn task_context_message(&self) -> Option<ChatMessage>
pub fn task_context_message(&self) -> Option<ChatMessage>
The context message describing a terminal background-task event, or
None for every other event.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolEvent
impl<'de> Deserialize<'de> for ToolEvent
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<TaskOutcome> for ToolEvent
impl From<TaskOutcome> for ToolEvent
Source§fn from(outcome: TaskOutcome) -> Self
fn from(outcome: TaskOutcome) -> Self
Converts to this type from the input type.
Source§impl JsonSchema for ToolEvent
impl JsonSchema for ToolEvent
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 moreimpl StructuralPartialEq for ToolEvent
Auto Trait Implementations§
impl Freeze for ToolEvent
impl RefUnwindSafe for ToolEvent
impl Send for ToolEvent
impl Sync for ToolEvent
impl Unpin for ToolEvent
impl UnsafeUnpin for ToolEvent
impl UnwindSafe for ToolEvent
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
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.