StandardToolCallDeserializer

org.llm4s.llmconnect.serialization.StandardToolCallDeserializer

Standard tool call deserializer for most LLM providers (OpenAI, Anthropic, etc.).

Expects a flat JSON array of tool call objects, each containing an id and a function object with name and arguments fields. It is strict: a call that does not have that shape, or whose arguments are not JSON, fails with an exception, which the client's Try around its response parsing turns into a Left. Arguments nested more than 512 levels deep fail the same way, before they are parsed: they are model output, and a value that deep overflows the stack of whatever renders it next (#1562).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def deserializeToolCalls(toolCallsJson: Value): Vector[ToolCall]

Parse a JSON value containing tool calls into a uniform sequence.

Parse a JSON value containing tool calls into a uniform sequence.

Value parameters

toolCallsJson

the raw JSON value from the provider's response

Attributes

Returns

parsed tool calls with id, function name, and arguments