enum

Smith::LLM::StopReason

Inherits Enum < Comparable < Value < Object

Why the model stopped, normalised across providers.

Anthropic says end_turn/tool_use/max_tokens; the OpenAI shape — which OpenAI, OpenRouter and Ollama all speak — says stop/tool_calls/length.

Constants

EndTurn = 0
ToolUse = 1
MaxTokens = 2
StopSequence = 3
Unknown = 4

Constructors

from_raw(raw : String | Nil) : StopReason
Source

Instance methods

end_turn?

Returns true if this enum value equals EndTurn

Source
max_tokens?

Returns true if this enum value equals MaxTokens

Source
stop_sequence?

Returns true if this enum value equals StopSequence

Source
tool_use?

Returns true if this enum value equals ToolUse

Source
unknown?

Returns true if this enum value equals Unknown

Source