Class: Durable::Llm::Providers::OpenAI::OpenAIStreamDelta

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delta) ⇒ OpenAIStreamDelta

Returns a new instance of OpenAIStreamDelta.



235
236
237
238
# File 'lib/durable/llm/providers/openai.rb', line 235

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



233
234
235
# File 'lib/durable/llm/providers/openai.rb', line 233

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



233
234
235
# File 'lib/durable/llm/providers/openai.rb', line 233

def role
  @role
end

Instance Method Details

#to_sObject



240
241
242
# File 'lib/durable/llm/providers/openai.rb', line 240

def to_s
  @content || ''
end