Class: Durable::Llm::Providers::Anthropic::AnthropicChoice
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Anthropic::AnthropicChoice
- Defined in:
- lib/durable/llm/providers/anthropic.rb
Overview
Represents a single choice in an Anthropic messages response.
Anthropic typically returns only one choice, containing the assistant’s message.
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#stop_reason ⇒ Object
readonly
Returns the value of attribute stop_reason.
Instance Method Summary collapse
-
#initialize(response) ⇒ AnthropicChoice
constructor
A new instance of AnthropicChoice.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ AnthropicChoice
Returns a new instance of AnthropicChoice.
293 294 295 296 |
# File 'lib/durable/llm/providers/anthropic.rb', line 293 def initialize(response) = AnthropicMessage.new(response) @stop_reason = response['stop_reason'] end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
291 292 293 |
# File 'lib/durable/llm/providers/anthropic.rb', line 291 def end |
#stop_reason ⇒ Object (readonly)
Returns the value of attribute stop_reason.
291 292 293 |
# File 'lib/durable/llm/providers/anthropic.rb', line 291 def stop_reason @stop_reason end |
Instance Method Details
#to_s ⇒ Object
298 299 300 |
# File 'lib/durable/llm/providers/anthropic.rb', line 298 def to_s .to_s end |