Class: Durable::Llm::Providers::Fireworks::FireworksResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Fireworks::FireworksResponse
- Defined in:
- lib/durable/llm/providers/fireworks.rb
Overview
Response object for Fireworks chat API responses.
Wraps the raw response and provides a consistent interface for accessing message content and metadata.
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) ⇒ FireworksResponse
constructor
A new instance of FireworksResponse.
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ FireworksResponse
Returns a new instance of FireworksResponse.
188 189 190 |
# File 'lib/durable/llm/providers/fireworks.rb', line 188 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
186 187 188 |
# File 'lib/durable/llm/providers/fireworks.rb', line 186 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
192 193 194 |
# File 'lib/durable/llm/providers/fireworks.rb', line 192 def choices @raw_response['choices'].map { |choice| FireworksChoice.new(choice) } end |
#data ⇒ Object
196 197 198 |
# File 'lib/durable/llm/providers/fireworks.rb', line 196 def data @raw_response['data'] end |
#to_s ⇒ Object
200 201 202 |
# File 'lib/durable/llm/providers/fireworks.rb', line 200 def to_s choices.map(&:to_s).join(' ') end |