class Riffer::Providers::FinishReason
Normalized reason an LLM call finished, paired with the provider’s raw wire value. reason carries the same meaning for every provider.
Constants
- VALUES
-
The normalized vocabulary every provider maps into.
Attributes
The provider’s raw finish-reason value, when one exists on the wire.
The normalized reason.
Public Class Methods
Source
# File lib/riffer/providers/finish_reason.rb, line 19 def initialize(reason:, raw: nil) unless VALUES.include?(reason) raise Riffer::ArgumentError, "reason must be one of #{VALUES.inspect}, got #{reason.inspect}" end @reason = reason @raw = raw end
Raises Riffer::ArgumentError when reason is outside VALUES.