Class: Durable::Llm::Providers::Mistral::MistralChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Mistral::MistralChoice
- Defined in:
- lib/durable/llm/providers/mistral.rb
Overview
Represents a single completion choice from Mistral AI
Contains the message content and finish reason for a completion choice.
Instance Attribute Summary collapse
-
#finish_reason ⇒ Object
readonly
Returns the value of attribute finish_reason.
-
#message ⇒ MistralMessage
readonly
The message object for this choice.
Instance Method Summary collapse
-
#initialize(choice) ⇒ MistralChoice
constructor
Initializes a new choice object.
-
#to_s ⇒ String
Returns the text content of the message.
Constructor Details
#initialize(choice) ⇒ MistralChoice
Initializes a new choice object
289 290 291 292 |
# File 'lib/durable/llm/providers/mistral.rb', line 289 def initialize(choice) @message = MistralMessage.new(choice['message']) @finish_reason = choice['finish_reason'] end |
Instance Attribute Details
#finish_reason ⇒ Object (readonly)
Returns the value of attribute finish_reason.
284 |
# File 'lib/durable/llm/providers/mistral.rb', line 284 attr_reader :message, :finish_reason |
#message ⇒ MistralMessage (readonly)
Returns The message object for this choice.
284 285 286 |
# File 'lib/durable/llm/providers/mistral.rb', line 284 def @message end |
Instance Method Details
#to_s ⇒ String
Returns the text content of the message
297 298 299 |
# File 'lib/durable/llm/providers/mistral.rb', line 297 def to_s @message.to_s end |