Class: Durable::Llm::Providers::Together::TogetherStreamDelta

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

Overview

Represents a delta in streaming responses.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delta) ⇒ TogetherStreamDelta

Initializes a stream delta.

Parameters:

  • delta (Hash)

    The delta data



329
330
331
332
# File 'lib/durable/llm/providers/together.rb', line 329

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

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



324
325
326
# File 'lib/durable/llm/providers/together.rb', line 324

def content
  @content
end

#roleObject (readonly)

Returns the value of attribute role.



324
325
326
# File 'lib/durable/llm/providers/together.rb', line 324

def role
  @role
end

Instance Method Details

#to_sString

Converts to string.

Returns:

  • (String)

    The content or empty string



337
338
339
# File 'lib/durable/llm/providers/together.rb', line 337

def to_s
  @content || ''
end