Class: Durable::Llm::Providers::Groq::GroqStreamChoice

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(choice) ⇒ GroqStreamChoice

Returns a new instance of GroqStreamChoice.



216
217
218
219
220
# File 'lib/durable/llm/providers/groq.rb', line 216

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

Instance Attribute Details

#deltaObject (readonly)

Returns the value of attribute delta.



214
215
216
# File 'lib/durable/llm/providers/groq.rb', line 214

def delta
  @delta
end

#finish_reasonObject (readonly)

Returns the value of attribute finish_reason.



214
215
216
# File 'lib/durable/llm/providers/groq.rb', line 214

def finish_reason
  @finish_reason
end

Instance Method Details

#to_sObject



222
223
224
# File 'lib/durable/llm/providers/groq.rb', line 222

def to_s
  @delta.to_s
end