Class: Durable::Llm::Providers::OpenRouter::OpenRouterChoice

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/openrouter.rb

Overview

Choice wrapper for OpenRouter API responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_reasonObject (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

#messageObject (readonly)

Returns the value of attribute message.



171
172
173
# File 'lib/durable/llm/providers/openrouter.rb', line 171

def message
  @message
end

Instance Method Details

#to_sObject



178
179
180
# File 'lib/durable/llm/providers/openrouter.rb', line 178

def to_s
  @message.to_s
end