Class: Durable::Llm::Providers::Perplexity::PerplexityStreamDelta
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Perplexity::PerplexityStreamDelta
- Defined in:
- lib/durable/llm/providers/perplexity.rb
Overview
Represents a delta (incremental content) in a Perplexity streaming response.
Contains the role and content delta for streaming updates.
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) ⇒ PerplexityStreamDelta
constructor
A new instance of PerplexityStreamDelta.
- #to_s ⇒ Object
Constructor Details
#initialize(delta) ⇒ PerplexityStreamDelta
Returns a new instance of PerplexityStreamDelta.
259 260 261 262 |
# File 'lib/durable/llm/providers/perplexity.rb', line 259 def initialize(delta) @role = delta['role'] @content = delta['content'] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
257 258 259 |
# File 'lib/durable/llm/providers/perplexity.rb', line 257 def content @content end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
257 258 259 |
# File 'lib/durable/llm/providers/perplexity.rb', line 257 def role @role end |
Instance Method Details
#to_s ⇒ Object
264 265 266 |
# File 'lib/durable/llm/providers/perplexity.rb', line 264 def to_s @content || '' end |