Raxol.AgentClientProtocol.Schema.AgentTypes.StopReason (Raxol Agent Client Protocol v0.1.0)

Copy Markdown View Source

Why a session/prompt turn ended.

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

Summary

Functions

Total: unrecognized stop reason strings return {:error, {:invalid_stop_reason, _}} instead of raising (upstream's version had no catch-all clause here).

Types

t()

@type t() :: :end_turn | :max_tokens | :max_turn_requests | :refusal | :cancelled

Functions

from_json(other)

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

Total: unrecognized stop reason strings return {:error, {:invalid_stop_reason, _}} instead of raising (upstream's version had no catch-all clause here).

to_json(atom)

@spec to_json(t()) :: String.t()