Class: Durable::Llm::Providers::Anthropic::AnthropicStreamChoice

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

Overview

Represents a single choice in a streaming Anthropic response chunk.

Contains the delta (incremental content) for the choice.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ AnthropicStreamChoice



347
348
349
# File 'lib/durable/llm/providers/anthropic.rb', line 347

def initialize(event)
  @delta = AnthropicStreamDelta.new(event['delta'])
end

Instance Attribute Details

#deltaObject (readonly)

Returns the value of attribute delta.



345
346
347
# File 'lib/durable/llm/providers/anthropic.rb', line 345

def delta
  @delta
end

Instance Method Details

#to_sObject



351
352
353
# File 'lib/durable/llm/providers/anthropic.rb', line 351

def to_s
  @delta.to_s
end