LlamaCompletionChunkToolCall class

A tool call in a completion chunk, shaped like OpenAI's streaming ToolCall.

LlamaEngine.create does not stream calls as fragments. It emits each call once, complete, in the final chunk, whose finishReason is tool_calls. When the backend reports that the reply ended at the token limit, every call is withheld, including complete ones, and the reply finishes with length.

Constructors

LlamaCompletionChunkToolCall({required int index, String? id, String? type, LlamaCompletionChunkFunction? function})
Creates a new LlamaCompletionChunkToolCall.
LlamaCompletionChunkToolCall.fromJson(Map<String, dynamic> json)
Creates a LlamaCompletionChunkToolCall from a JSON map.
factory

Properties

function → LlamaCompletionChunkFunction?
The function name and its arguments text.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String?
The call ID. LlamaEngine.create fills call_<index> when the model output has none.
final
index → int
The position of this call among the calls of the completion.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → String?
The type of the tool call. Usually "function".
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts this object to a JSON map.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited