Raxol.AgentClientProtocol.Schema.ToolCallContent (Raxol Agent Client Protocol v0.1.0)

Copy Markdown View Source

Content produced by a tool call: a tagged union discriminated by a "type" wire key (content | diff | terminal).

Ported from the MIT f1729/agent_client_protocol (c) 2025 f1729; see NOTICE.md.

Summary

Functions

Total: never raises. An unrecognized/missing "type", or a variant body that fails to decode, returns {:error, _}. Callers decoding a ToolCallContent list (ToolCall.content, ToolCallUpdateFields.content) skip items that error rather than failing the whole list.

Types

Functions

content(wrapper)

diff(diff)

from_json(map)

@spec from_json(term()) :: {:ok, t()} | {:error, term()}

Total: never raises. An unrecognized/missing "type", or a variant body that fails to decode, returns {:error, _}. Callers decoding a ToolCallContent list (ToolCall.content, ToolCallUpdateFields.content) skip items that error rather than failing the whole list.

terminal(terminal)

to_json(arg)

@spec to_json(t()) :: map()