Class: Durable::Llm::Providers::Fireworks::FireworksResponse
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Fireworks::FireworksResponse
- Defined in:
- lib/durable/llm/providers/fireworks.rb
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
180 181 182 |
# File 'lib/durable/llm/providers/fireworks.rb', line 180 def initialize(response) @raw_response = response end |
Instance Attribute Details
#raw_response ⇒ Object (readonly)
Returns the value of attribute raw_response.
178 179 180 |
# File 'lib/durable/llm/providers/fireworks.rb', line 178 def raw_response @raw_response end |
Instance Method Details
#choices ⇒ Object
184 185 186 |
# File 'lib/durable/llm/providers/fireworks.rb', line 184 def choices @raw_response['choices'].map { |choice| FireworksChoice.new(choice) } end |
#data ⇒ Object
188 189 190 |
# File 'lib/durable/llm/providers/fireworks.rb', line 188 def data @raw_response['data'] end |
#to_s ⇒ Object
192 193 194 |
# File 'lib/durable/llm/providers/fireworks.rb', line 192 def to_s choices.map(&:to_s).join(' ') end |