Class: Durable::Llm::Providers::OpenAI::OpenAIChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::OpenAI::OpenAIChoice
- Defined in:
- lib/durable/llm/providers/openai.rb
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) ⇒ OpenAIChoice
constructor
A new instance of OpenAIChoice.
- #to_s ⇒ Object
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_reason ⇒ Object (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 |
#message ⇒ Object (readonly)
Returns the value of attribute message.
169 170 171 |
# File 'lib/durable/llm/providers/openai.rb', line 169 def @message end |
Instance Method Details
#to_s ⇒ Object
176 177 178 |
# File 'lib/durable/llm/providers/openai.rb', line 176 def to_s @message.to_s end |