public/types/tool_calling_types library

Tool Calling Types for RunAnywhere SDK

Type definitions for tool calling (function calling) functionality. Allows LLMs to request external actions (API calls, device functions, etc.)

Mirrors Swift SDK's ToolCallingTypes.swift

Classes

ArrayToolValue
BoolToolValue
NullToolValue
NumberToolValue
ObjectToolValue
StringToolValue
ToolCall
A request from the LLM to execute a tool
ToolCallFormatName
Constants for tool call format names.
ToolCallingOptions
Options for tool-enabled generation
ToolCallingResult
Result of a generation that may include tool calls
ToolDefinition
Definition of a tool that the LLM can use
ToolParameter
A single parameter definition for a tool
ToolResult
Result of executing a tool
ToolValue
A type-safe representation of JSON values for tool arguments and results. Avoids using dynamic while supporting all JSON types.

Enums

ToolParameterType
Supported parameter types for tool arguments

Functions

dynamicMapToToolValueMap(Map<String, dynamic> map) Map<String, ToolValue>
Convert Map<String, dynamic> to Map<String, ToolValue>
toolResultToJsonString(Map<String, ToolValue> result) String
Convert Map<String, ToolValue> to JSON string
toolsToJson(List<ToolDefinition> tools) String
Serialize tools to JSON string

Typedefs

ToolExecutor = Future<Map<String, ToolValue>> Function(Map<String, ToolValue> args)
Function type for tool executors. Takes arguments as strongly-typed ToolValue map, returns result map.