Class: Durable::Llm::Providers::Anthropic::AnthropicResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Anthropic::AnthropicResponse
- Defined in:
- lib/durable/llm/providers/anthropic.rb
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #choices ⇒ Object
-
#initialize(response) ⇒ AnthropicResponse
constructor
A new instance of AnthropicResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ AnthropicResponse
Returns a new instance of AnthropicResponse.
90 91 92 |
# File 'lib/durable/llm/providers/anthropic.rb', line 90 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
88 89 90 |
# File 'lib/durable/llm/providers/anthropic.rb', line 88 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
94 95 96 |
# File 'lib/durable/llm/providers/anthropic.rb', line 94 def choices [@raw_response['content']].map { |content| AnthropicChoice.new(content) } end |
#to_s ⇒ Object
98 99 100 |
# File 'lib/durable/llm/providers/anthropic.rb', line 98 def to_s choices.map(&:to_s).join(' ') end |