Class: Durable::Llm::Providers::DeepSeek::DeepSeekResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::DeepSeek::DeepSeekResponse
- Defined in:
- lib/durable/llm/providers/deepseek.rb
Overview
Response wrapper for DeepSeek API responses
Instance Attribute Summary collapse
-
#raw_response ⇒ Object
readonly
Returns the value of attribute raw_response.
Instance Method Summary collapse
- #choices ⇒ Object
- #data ⇒ Object
-
#initialize(response) ⇒ DeepSeekResponse
constructor
A new instance of DeepSeekResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ DeepSeekResponse
Returns a new instance of DeepSeekResponse.
129 130 131 |
# File 'lib/durable/llm/providers/deepseek.rb', line 129 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
127 128 129 |
# File 'lib/durable/llm/providers/deepseek.rb', line 127 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
133 134 135 |
# File 'lib/durable/llm/providers/deepseek.rb', line 133 def choices @raw_response['choices'].map { |choice| DeepSeekChoice.new(choice) } end |
#data ⇒ Object
137 138 139 |
# File 'lib/durable/llm/providers/deepseek.rb', line 137 def data @raw_response['data'] end |
#to_s ⇒ Object
141 142 143 |
# File 'lib/durable/llm/providers/deepseek.rb', line 141 def to_s choices.map(&:to_s).join(' ') end |