pub enum ToolEvent {
Show 14 variants
InputStarted {
id: String,
name: String,
},
InputDelta {
id: String,
chunk: String,
},
Call {
request: ToolCallRequest,
},
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§
InputStarted
InputDelta
Call
Fields
§
request: ToolCallRequestProgress
SubAgentProgress
DisplayUpdate
TaskCreated
TaskStatus
TaskCompleted
TaskFailed
TaskCancelled
Result
Error
Fields
§
error: ToolCallErrorDefinitionsUpdated
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