Class: Durable::Llm::Providers::Anthropic::AnthropicStreamDelta
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Anthropic::AnthropicStreamDelta
- Defined in:
- lib/durable/llm/providers/anthropic.rb
Overview
Represents the incremental content delta in a streaming response.
Contains the type and text content of the delta.
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(delta) ⇒ AnthropicStreamDelta
constructor
A new instance of AnthropicStreamDelta.
- #to_s ⇒ Object
Constructor Details
#initialize(delta) ⇒ AnthropicStreamDelta
Returns a new instance of AnthropicStreamDelta.
362 363 364 365 |
# File 'lib/durable/llm/providers/anthropic.rb', line 362 def initialize(delta) @type = delta['type'] @text = delta['text'] end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
360 361 362 |
# File 'lib/durable/llm/providers/anthropic.rb', line 360 def text @text end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
360 361 362 |
# File 'lib/durable/llm/providers/anthropic.rb', line 360 def type @type end |
Instance Method Details
#to_s ⇒ Object
367 368 369 |
# File 'lib/durable/llm/providers/anthropic.rb', line 367 def to_s @text || '' end |