A chunk of a tool call (yielded when streaming).
public class ToolCallChunkA chunk of a tool call (yielded when streaming).
When merging ToolCallChunks (e.g., via AIMessageChunk.__add__), all string
attributes are concatenated. Chunks are only merged if their values of index are
equal and not None.
Example:
left_chunks = [ToolCallChunk(name="foo", args='{"a":', index=0)]
right_chunks = [ToolCallChunk(name=None, args="1}", index=0)]
(
AIMessageChunk(content="", tool_call_chunks=left_chunks)
+ AIMessageChunk(content="", tool_call_chunks=right_chunks)
).tool_call_chunks == [ToolCallChunk(name="foo", args='{"a":1}', index=0)](e.g.
(e.g.
(e.g.
(e.g.
(e.g.
Returns the raw JSON value of [id].
Returns the raw JSON value of [args].
Returns the raw JSON value of [index].
Returns the raw JSON value of [name].
Returns the raw JSON value of [type].
Returns a mutable builder for constructing an instance of [ToolCallChunk].
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
Returns an immutable instance of [ToolCallChunk].
Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if the class was instantiated with an unknown value.
Returns an enum member corresponding to this class instance's value.
Returns this class instance's primitive wire representation.
Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] if the class was instantiated with an unknown value.
Returns an enum member corresponding to this class instance's value.
Returns this class instance's primitive wire representation.
unexpectedly missing or null (e.g.
(e.g.
(e.g.
(e.g.
Returns the raw JSON value of [content].
Returns the raw JSON value of [id].
Returns the raw JSON value of [name].
Returns the raw JSON value of [type].
Returns a mutable builder for constructing an instance of [ToolCallChunk].
unexpectedly missing or null (e.g.
unexpectedly missing or null (e.g.
unexpectedly missing or null (e.g.
Alias for calling [content] with
Content.ofUnnamedSchemaWithArrayParent7s(unnamedSchemaWithArrayParent7s)..
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
(e.g.
Returns an immutable instance of [ToolCallChunk].
Returns this class instance's primitive wire representation.