Class: Durable::Llm::Providers::Fireworks::FireworksResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/fireworks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_responseObject (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

#choicesObject



184
185
186
# File 'lib/durable/llm/providers/fireworks.rb', line 184

def choices
  @raw_response['choices'].map { |choice| FireworksChoice.new(choice) }
end

#dataObject



188
189
190
# File 'lib/durable/llm/providers/fireworks.rb', line 188

def data
  @raw_response['data']
end

#to_sObject



192
193
194
# File 'lib/durable/llm/providers/fireworks.rb', line 192

def to_s
  choices.map(&:to_s).join(' ')
end