pub struct ToolCall {
pub id: ToolCallId,
pub title: String,
pub kind: ToolKind,
pub status: ToolCallStatus,
pub content: Vec<ToolCallContent>,
pub locations: Vec<ToolCallLocation>,
pub raw_input: Option<Value>,
pub raw_output: Option<Value>,
pub meta: Option<Value>,
}
Expand description
Represents a tool call that the language model has requested.
Tool calls are actions that the agent executes on behalf of the language model, such as reading files, executing code, or fetching data from external sources.
See protocol docs: Tool Calls
Fields§
§id: ToolCallId
Unique identifier for this tool call within the session.
title: String
Human-readable title describing what the tool is doing.
kind: ToolKind
The category of tool being invoked. Helps clients choose appropriate icons and UI treatment.
status: ToolCallStatus
Current execution status of the tool call.
content: Vec<ToolCallContent>
Content produced by the tool call.
locations: Vec<ToolCallLocation>
File locations affected by this tool call. Enables “follow-along” features in clients.
raw_input: Option<Value>
Raw input parameters sent to the tool.
raw_output: Option<Value>
Raw output returned by the tool.
meta: Option<Value>
Extension point for implementations
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ToolCall
impl<'de> Deserialize<'de> for ToolCall
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<ToolCall> for ToolCallUpdate
impl From<ToolCall> for ToolCallUpdate
Source§impl JsonSchema for ToolCall
impl JsonSchema for ToolCall
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 TryFrom<ToolCallUpdate> for ToolCall
If a given tool call doesn’t exist yet, allows for attempting to construct
one from a tool call update if possible.
impl TryFrom<ToolCallUpdate> for ToolCall
If a given tool call doesn’t exist yet, allows for attempting to construct one from a tool call update if possible.