Class: Durable::Llm::Providers::Fireworks::FireworksStreamDelta

Inherits:
Object
  • Object
show all
Defined in:
lib/durable/llm/providers/fireworks.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) ⇒ FireworksStreamDelta

Returns a new instance of FireworksStreamDelta.



290
291
292
293
# File 'lib/durable/llm/providers/fireworks.rb', line 290

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



288
289
290
# File 'lib/durable/llm/providers/fireworks.rb', line 288

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



288
289
290
# File 'lib/durable/llm/providers/fireworks.rb', line 288

def role
  @role
end

Instance Method Details

#to_sObject



295
296
297
# File 'lib/durable/llm/providers/fireworks.rb', line 295

def to_s
  @content || ''
end