Class: Durable::Llm::Providers::Fireworks::FireworksStreamChoice

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(choice) ⇒ FireworksStreamChoice

Returns a new instance of FireworksStreamChoice.



250
251
252
253
254
# File 'lib/durable/llm/providers/fireworks.rb', line 250

def initialize(choice)
  @choice = [choice].flatten.first
  @delta = FireworksStreamDelta.new(@choice['delta'])
  @finish_reason = @choice['finish_reason']
end

Instance Attribute Details

#deltaObject (readonly)

Returns the value of attribute delta.



248
249
250
# File 'lib/durable/llm/providers/fireworks.rb', line 248

def delta
  @delta
end

#finish_reasonObject (readonly)

Returns the value of attribute finish_reason.



248
249
250
# File 'lib/durable/llm/providers/fireworks.rb', line 248

def finish_reason
  @finish_reason
end

Instance Method Details

#to_sObject



256
257
258
# File 'lib/durable/llm/providers/fireworks.rb', line 256

def to_s
  @delta.to_s
end