Class: Durable::Llm::Providers::Opencode::OpencodeStreamDelta

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

Overview

Stream delta class for OpenCode API

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delta) ⇒ OpencodeStreamDelta

Returns a new instance of OpencodeStreamDelta.



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

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



237
238
239
# File 'lib/durable/llm/providers/opencode.rb', line 237

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



237
238
239
# File 'lib/durable/llm/providers/opencode.rb', line 237

def role
  @role
end

Instance Method Details

#to_sObject



244
245
246
# File 'lib/durable/llm/providers/opencode.rb', line 244

def to_s
  @content || ''
end