pub struct ToolResultPart {
pub tool_call_id: String,
pub tool_name: String,
pub output: ToolResultOutput,
pub preliminary: Option<bool>,
pub provider_metadata: Option<HashMap<String, HashMap<String, JsonValue>>>,
}Expand description
The result of executing a tool or function in response to a model’s tool call.
After the model requests a tool invocation via ToolCallPart, the results of that execution are communicated back through this message type. It contains the output from the tool execution, which may be text, structured data, or an error message.
§Fields
tool_call_id- References the ToolCallPart this result corresponds totool_name- Name of the tool that was executedoutput- The result from tool execution (text, structured, or error)preliminary- If true, this is a partial result; more results may followprovider_metadata- Optional provider-specific details about execution
§Including Tool Results in Messages
Tool results must be included in the message history when making subsequent requests, so the model can see what happened and make appropriate follow-up decisions.
Fields§
§tool_call_id: StringIdentifier linking this result to the corresponding tool call
tool_name: StringName of the tool that was executed
output: ToolResultOutputThe structured output or result from executing the tool
preliminary: Option<bool>If true, this is a preliminary result and more results may be forthcoming
provider_metadata: Option<HashMap<String, HashMap<String, JsonValue>>>Optional provider-specific metadata about the tool execution
Trait Implementations§
Source§impl Clone for ToolResultPart
impl Clone for ToolResultPart
Source§fn clone(&self) -> ToolResultPart
fn clone(&self) -> ToolResultPart
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more