Class: Durable::Llm::Providers::Anthropic::AnthropicStreamDelta

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delta) ⇒ AnthropicStreamDelta

Returns a new instance of AnthropicStreamDelta.



156
157
158
159
# File 'lib/durable/llm/providers/anthropic.rb', line 156

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

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



154
155
156
# File 'lib/durable/llm/providers/anthropic.rb', line 154

def text
  @text
end

#typeObject (readonly)

Returns the value of attribute type.



154
155
156
# File 'lib/durable/llm/providers/anthropic.rb', line 154

def type
  @type
end

Instance Method Details

#to_sObject



161
162
163
# File 'lib/durable/llm/providers/anthropic.rb', line 161

def to_s
  @text || ''
end