Class: Durable::Llm::Providers::OpenRouter::OpenRouterStreamDelta

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

Overview

Stream delta wrapper for OpenRouter API streaming responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delta) ⇒ OpenRouterStreamDelta

Returns a new instance of OpenRouterStreamDelta.



242
243
244
245
# File 'lib/durable/llm/providers/openrouter.rb', line 242

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



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

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



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

def role
  @role
end

Instance Method Details

#to_sObject



247
248
249
# File 'lib/durable/llm/providers/openrouter.rb', line 247

def to_s
  @content || ''
end