Class: Durable::Llm::Providers::OpenAI::OpenAIStreamDelta
- Inherits:
-
Object
- Object
- Durable::Llm::Providers::OpenAI::OpenAIStreamDelta
- Defined in:
- lib/durable/llm/providers/openai.rb
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) ⇒ OpenAIStreamDelta
constructor
A new instance of OpenAIStreamDelta.
- #to_s ⇒ Object
Constructor Details
#initialize(delta) ⇒ OpenAIStreamDelta
Returns a new instance of OpenAIStreamDelta.
235 236 237 238 |
# File 'lib/durable/llm/providers/openai.rb', line 235 def initialize(delta) @role = delta['role'] @content = delta['content'] end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
233 234 235 |
# File 'lib/durable/llm/providers/openai.rb', line 233 def content @content end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
233 234 235 |
# File 'lib/durable/llm/providers/openai.rb', line 233 def role @role end |
Instance Method Details
#to_s ⇒ Object
240 241 242 |
# File 'lib/durable/llm/providers/openai.rb', line 240 def to_s @content || '' end |