Class: Durable::Llm::Providers::Groq::GroqStreamDelta

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

Overview

Represents the incremental content delta in a streaming response.

Contains the role and text content of the delta.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delta) ⇒ GroqStreamDelta

Returns a new instance of GroqStreamDelta.



253
254
255
256
# File 'lib/durable/llm/providers/groq.rb', line 253

def initialize(delta)
  @role = delta['role']
  @content = delta['content']
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



251
252
253
# File 'lib/durable/llm/providers/groq.rb', line 251

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



251
252
253
# File 'lib/durable/llm/providers/groq.rb', line 251

def role
  @role
end

Instance Method Details

#to_sObject



258
259
260
# File 'lib/durable/llm/providers/groq.rb', line 258

def to_s
  @content || ''
end