ToolCall

org.llm4s.llmconnect.model.ToolCall
See theToolCall companion object
@Stable
final case class ToolCall

A single tool invocation requested by the LLM.

The LLM generates id to correlate this request with its ToolMessage response; the agent framework forwards id unchanged when constructing ToolMessage values, so do not modify it.

arguments is a parsed ujson.Value (typically a JSON object), not a raw string. Its numbers are doubles, so a whole number above 2^53 is already rounded; a tool that takes large identifiers declares them as strings. Use arguments.obj to access fields or pass it directly to org.llm4s.toolapi.ToolRegistry.execute via a org.llm4s.toolapi.ToolCallRequest.

Value parameters

arguments

Parsed JSON arguments; the schema is defined by the tool's org.llm4s.toolapi.Schema.

id

Provider-generated identifier; matched by the corresponding ToolMessage.toolCallId.

name

Name of the tool to invoke; must match a registered org.llm4s.toolapi.ToolFunction.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
def withArguments(arguments: Value): ToolCall

Sets the parsed arguments.

Sets the parsed arguments.

Attributes

def withId(id: String): ToolCall

Sets the identifier.

Sets the identifier.

Attributes

def withName(name: String): ToolCall

Sets the tool name.

Sets the tool name.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product