enum

AI::Provider::LanguageModel::UnifiedFinishReason

Inherits Enum < Comparable < Value < Object

Unified finish reason across different providers.

Constants

Stop = 0

Model generated stop sequence.

Length = 1

Model generated maximum number of tokens.

ContentFilter = 2

Content filter violation stopped the model.

ToolCalls = 3

Model triggered tool calls.

Error = 4

Model stopped because of an error.

Other = 5

Model stopped for other reasons.

Instance methods

content_filter?

Returns true if this enum value equals ContentFilter

Source
error?

Returns true if this enum value equals Error

Source
length?

Returns true if this enum value equals Length

Source
other?

Returns true if this enum value equals Other

Source
stop?

Returns true if this enum value equals Stop

Source
to_s

Returns a String representation of this enum member. In the case of regular enums, this is just the name of the member. In the case of flag enums, it's the names joined by vertical bars, or "None", if the value is zero.

If an enum's value doesn't match a member's value, the raw value is returned as a string.

Color::Red.to_s                     # => "Red"
IOMode::None.to_s                   # => "None"
(IOMode::Read | IOMode::Write).to_s # => "Read | Write"

Color.new(10).to_s # => "10"
Source
tool_calls?

Returns true if this enum value equals ToolCalls

Source