Class: Durable::Llm::Providers::OpenRouter::OpenRouterStreamDelta
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::OpenRouter::OpenRouterStreamDelta
- Defined in:
- lib/durable/llm/providers/openrouter.rb
Overview
Stream delta wrapper for OpenRouter API streaming responses.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
-
#initialize(delta) ⇒ OpenRouterStreamDelta
constructor
A new instance of OpenRouterStreamDelta.
- #to_s ⇒ Object
Constructor Details
#initialize(delta) ⇒ OpenRouterStreamDelta
Returns a new instance of OpenRouterStreamDelta.
242 243 244 245 |
# File 'lib/durable/llm/providers/openrouter.rb', line 242 def initialize(delta) @role = delta['role'] @content = delta['content'] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
240 241 242 |
# File 'lib/durable/llm/providers/openrouter.rb', line 240 def content @content end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
240 241 242 |
# File 'lib/durable/llm/providers/openrouter.rb', line 240 def role @role end |
Instance Method Details
#to_s ⇒ Object
247 248 249 |
# File 'lib/durable/llm/providers/openrouter.rb', line 247 def to_s @content || '' end |