pub struct ToolResult {
pub call: ToolCallId,
pub provider: Option<ProviderCallId>,
pub name: String,
pub content: Vec<ToolResultContent>,
}Expand description
Tool result content containing information about a tool call and it’s resulting content.
Fields§
§call: ToolCallIdWhich call this result answers — rig’s correlation handle, always
present. Copied from the answered ToolCall::id, which is minted
at the provider boundary when the provider issued no identifier.
provider: Option<ProviderCallId>What the provider issued for the answered call, if anything — the only identifiers that may travel back on that provider’s wire.
name: StringName of the tool that produced this result — the executed tool, which can differ from the model’s call when a hook repaired it.
Required: several wires key the replay on it (Gemini’s
functionResponse.name, Ollama’s tool messages), and an identifier
is not a name — rig used to smuggle the name through the id, which
collided two calls to the same tool and misnamed cross-provider
replays (review 84a43e9e #5).
content: Vec<ToolResultContent>One or more content items produced by the tool.
Implementations§
Source§impl ToolResult
impl ToolResult
Sourcepub fn wire_call_id(&self) -> &str
pub fn wire_call_id(&self) -> &str
The identifier for a wire whose call-id slot is required: the
provider-issued call_id when the provider issued one, else rig’s
minted handle — always non-empty.
Wires whose id slot is optional (Gemini REST, gRPC) must read
ToolResult::provider directly instead: minted handles never
travel upstream there.
Trait Implementations§
Source§impl Clone for ToolResult
impl Clone for ToolResult
Source§fn clone(&self) -> ToolResult
fn clone(&self) -> ToolResult
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more