Class: Durable::Llm::Providers::Groq::GroqStreamDelta
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::Groq::GroqStreamDelta
- Defined in:
- lib/durable/llm/providers/groq.rb
Overview
Represents the incremental content delta in a streaming response.
Contains the role and text content of the delta.
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) ⇒ GroqStreamDelta
constructor
A new instance of GroqStreamDelta.
- #to_s ⇒ Object
Constructor Details
#initialize(delta) ⇒ GroqStreamDelta
Returns a new instance of GroqStreamDelta.
253 254 255 256 |
# File 'lib/durable/llm/providers/groq.rb', line 253 def initialize(delta) @role = delta['role'] @content = delta['content'] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
251 252 253 |
# File 'lib/durable/llm/providers/groq.rb', line 251 def content @content end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
251 252 253 |
# File 'lib/durable/llm/providers/groq.rb', line 251 def role @role end |
Instance Method Details
#to_s ⇒ Object
258 259 260 |
# File 'lib/durable/llm/providers/groq.rb', line 258 def to_s @content || '' end |