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

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

Overview

Represents a single choice in a streaming Fireworks response chunk.

Contains the delta (incremental content) and finish reason for the choice.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(choice) ⇒ FireworksStreamChoice

Returns a new instance of FireworksStreamChoice.



273
274
275
276
277
# File 'lib/durable/llm/providers/fireworks.rb', line 273

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.



271
272
273
# File 'lib/durable/llm/providers/fireworks.rb', line 271

def delta
  @delta
end

#finish_reasonObject (readonly)

Returns the value of attribute finish_reason.



271
272
273
# File 'lib/durable/llm/providers/fireworks.rb', line 271

def finish_reason
  @finish_reason
end

Instance Method Details

#to_sObject



279
280
281
# File 'lib/durable/llm/providers/fireworks.rb', line 279

def to_s
  @delta.to_s
end