Class: Durable::Llm::Providers::OpenRouter::OpenRouterChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::OpenRouter::OpenRouterChoice
- Defined in:
- lib/durable/llm/providers/openrouter.rb
Overview
Choice wrapper for OpenRouter API responses.
Instance Attribute Summary collapse
-
#finish_reason ⇒ Object
readonly
Returns the value of attribute finish_reason.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(choice) ⇒ OpenRouterChoice
constructor
A new instance of OpenRouterChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(choice) ⇒ OpenRouterChoice
Returns a new instance of OpenRouterChoice.
173 174 175 176 |
# File 'lib/durable/llm/providers/openrouter.rb', line 173 def initialize(choice) @message = OpenRouterMessage.new(choice['message']) @finish_reason = choice['finish_reason'] end |
Instance Attribute Details
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
171 172 173 |
# File 'lib/durable/llm/providers/openrouter.rb', line 171 def finish_reason @finish_reason end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
171 172 173 |
# File 'lib/durable/llm/providers/openrouter.rb', line 171 def @message end |
Instance Method Details
#to_s ⇒ Object
178 179 180 |
# File 'lib/durable/llm/providers/openrouter.rb', line 178 def to_s @message.to_s end |