Class: Durable::Llm::Providers::Cohere::CohereStreamDelta

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

Overview

Represents the incremental content delta in a streaming response.

Contains the text content of the delta.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delta) ⇒ CohereStreamDelta

Returns a new instance of CohereStreamDelta.



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

def initialize(delta)
  @text = delta['text']
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



231
232
233
# File 'lib/durable/llm/providers/cohere.rb', line 231

def text
  @text
end

Instance Method Details

#to_sObject



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

def to_s
  @text || ''
end