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

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#choicesObject



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

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

#dataObject



196
197
198
# File 'lib/durable/llm/providers/fireworks.rb', line 196

def data
  @raw_response['data']
end

#to_sObject



200
201
202
# File 'lib/durable/llm/providers/fireworks.rb', line 200

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