Class: Durable::Llm::Providers::Perplexity::PerplexityStreamDelta

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content.



257
258
259
# File 'lib/durable/llm/providers/perplexity.rb', line 257

def content
  @content
end

#roleObject (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_sObject



264
265
266
# File 'lib/durable/llm/providers/perplexity.rb', line 264

def to_s
  @content || ''
end