#[non_exhaustive]pub struct ToolCallUpdate {
pub tool_call_id: ToolCallId,
pub title: MaybeUndefined<String>,
pub kind: MaybeUndefined<ToolKind>,
pub status: MaybeUndefined<ToolCallStatus>,
pub content: MaybeUndefined<Vec<ToolCallContent>>,
pub locations: MaybeUndefined<Vec<ToolCallLocation>>,
pub raw_input: MaybeUndefined<Value>,
pub raw_output: MaybeUndefined<Value>,
pub meta: Option<Map<String, Value>>,
}unstable_protocol_v2 only.Expand description
Represents an upsert for 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.
Only ToolCallUpdate::tool_call_id is required. Other fields have patch semantics:
omitted fields leave the existing tool call value unchanged, null clears or
unsets the value, and concrete values replace the previous value. For
collection fields, concrete arrays replace the previous collection, and both
null and [] clear the collection. When a client receives a tool call ID it
has not seen before, omitted fields use client defaults.
See protocol docs: Tool Calls
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.tool_call_id: ToolCallIdUnique identifier for this tool call within the session.
title: MaybeUndefined<String>Human-readable title describing what the tool is doing.
kind: MaybeUndefined<ToolKind>The category of tool being invoked. Helps clients choose appropriate icons and UI treatment.
status: MaybeUndefined<ToolCallStatus>Current execution status of the tool call.
content: MaybeUndefined<Vec<ToolCallContent>>Content produced by the tool call.
locations: MaybeUndefined<Vec<ToolCallLocation>>File locations affected by this tool call. Enables “follow-along” features in clients.
raw_input: MaybeUndefined<Value>Raw input parameters sent to the tool.
raw_output: MaybeUndefined<Value>Raw output returned by the tool.
meta: Option<Map<String, Value>>The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Implementations§
Source§impl ToolCallUpdate
impl ToolCallUpdate
Sourcepub fn new(tool_call_id: impl Into<ToolCallId>) -> ToolCallUpdate
pub fn new(tool_call_id: impl Into<ToolCallId>) -> ToolCallUpdate
Builds ToolCallUpdate with the required fields set; optional fields start unset or empty.
Sourcepub fn title(self, title: impl IntoMaybeUndefined<String>) -> ToolCallUpdate
pub fn title(self, title: impl IntoMaybeUndefined<String>) -> ToolCallUpdate
Human-readable title describing what the tool is doing.
Sourcepub fn kind(self, kind: impl IntoMaybeUndefined<ToolKind>) -> ToolCallUpdate
pub fn kind(self, kind: impl IntoMaybeUndefined<ToolKind>) -> ToolCallUpdate
The category of tool being invoked. Helps clients choose appropriate icons and UI treatment.
Sourcepub fn status(
self,
status: impl IntoMaybeUndefined<ToolCallStatus>,
) -> ToolCallUpdate
pub fn status( self, status: impl IntoMaybeUndefined<ToolCallStatus>, ) -> ToolCallUpdate
Current execution status of the tool call.
Sourcepub fn content(
self,
content: impl IntoMaybeUndefined<Vec<ToolCallContent>>,
) -> ToolCallUpdate
pub fn content( self, content: impl IntoMaybeUndefined<Vec<ToolCallContent>>, ) -> ToolCallUpdate
Content produced by the tool call.
Sourcepub fn locations(
self,
locations: impl IntoMaybeUndefined<Vec<ToolCallLocation>>,
) -> ToolCallUpdate
pub fn locations( self, locations: impl IntoMaybeUndefined<Vec<ToolCallLocation>>, ) -> ToolCallUpdate
File locations affected by this tool call. Enables “follow-along” features in clients.
Sourcepub fn raw_input(
self,
raw_input: impl IntoMaybeUndefined<Value>,
) -> ToolCallUpdate
pub fn raw_input( self, raw_input: impl IntoMaybeUndefined<Value>, ) -> ToolCallUpdate
Raw input parameters sent to the tool.
Sourcepub fn raw_output(
self,
raw_output: impl IntoMaybeUndefined<Value>,
) -> ToolCallUpdate
pub fn raw_output( self, raw_output: impl IntoMaybeUndefined<Value>, ) -> ToolCallUpdate
Raw output returned by the tool.
Sourcepub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> ToolCallUpdate
pub fn meta(self, meta: impl IntoOption<Map<String, Value>>) -> ToolCallUpdate
The _meta property is reserved by ACP to allow clients and agents to attach additional metadata to their interactions. Implementations MUST NOT make assumptions about values at these keys.
See protocol docs: Extensibility
Sourcepub fn apply_update(&mut self, update: ToolCallUpdate)
pub fn apply_update(&mut self, update: ToolCallUpdate)
Applies a later tool-call patch to this stored tool-call state.
Fields set to null are preserved as null so callers can decide how to
render an explicitly cleared value.
Trait Implementations§
Source§impl Clone for ToolCallUpdate
impl Clone for ToolCallUpdate
Source§fn clone(&self) -> ToolCallUpdate
fn clone(&self) -> ToolCallUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolCallUpdate
impl Debug for ToolCallUpdate
Source§impl<'de> Deserialize<'de> for ToolCallUpdate
impl<'de> Deserialize<'de> for ToolCallUpdate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolCallUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolCallUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl IntoV1 for ToolCallUpdate
impl IntoV1 for ToolCallUpdate
Source§type Output = ToolCallUpdate
type Output = ToolCallUpdate
Source§fn into_v1(
self,
) -> Result<<ToolCallUpdate as IntoV1>::Output, ProtocolConversionError>
fn into_v1( self, ) -> Result<<ToolCallUpdate as IntoV1>::Output, ProtocolConversionError>
Source§impl JsonSchema for ToolCallUpdate
impl JsonSchema for ToolCallUpdate
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 PartialEq for ToolCallUpdate
impl PartialEq for ToolCallUpdate
Source§fn eq(&self, other: &ToolCallUpdate) -> bool
fn eq(&self, other: &ToolCallUpdate) -> bool
self and other values to be equal, and is used by ==.