LLMToolCall class
Represents a tool call made by an LLM.
Constructors
- LLMToolCall({required String name, required String arguments, required String? id})
- Creates a typed tool call.
- LLMToolCall.from(Object value)
-
Normalizes old map-shaped calls and new typed calls into LLMToolCall.
factory
-
LLMToolCall.fromApiFormat(Map<
String, dynamic> json) -
Creates a tool call from an OpenAI/Ollama-style API object.
factory
Properties
- arguments → String
-
The JSON-encoded arguments for the tool.
final
-
argumentsJson
→ Map<
String, dynamic> -
Decodes arguments as a JSON object.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String?
-
Unique identifier for this tool call (used by some providers like ChatGPT).
final
- name → String
-
The name of the tool to call.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toApiFormat(
) → Map< String, dynamic> - Converts to OpenAI/Ollama API format for assistant message tool_calls.
-
toJson(
) → Map< String, dynamic> - Alias for APIs and tests that expect JSON conversion.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override