Class: Durable::Llm::Providers::OpenAI::OpenAIChoice

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(choice) ⇒ OpenAIChoice

Returns a new instance of OpenAIChoice.



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

def initialize(choice)
  @message = OpenAIMessage.new(choice['message'])
  @finish_reason = choice['finish_reason']
end

Instance Attribute Details

#finish_reasonObject (readonly)

Returns the value of attribute finish_reason.



169
170
171
# File 'lib/durable/llm/providers/openai.rb', line 169

def finish_reason
  @finish_reason
end

#messageObject (readonly)

Returns the value of attribute message.



169
170
171
# File 'lib/durable/llm/providers/openai.rb', line 169

def message
  @message
end

Instance Method Details

#to_sObject



176
177
178
# File 'lib/durable/llm/providers/openai.rb', line 176

def to_s
  @message.to_s
end