Class: OmniAI::Chat::Delta
- Inherits:
-
Object
- Object
- OmniAI::Chat::Delta
- Defined in:
- lib/omniai/chat/delta.rb
Overview
An OmniAI::Chat::Delta is used to assist with streaming. It represents a chunk of a conversation that is yielded back to the caller.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize(text: nil, thinking: nil) ⇒ Delta
constructor
A new instance of Delta.
- #text? ⇒ Boolean
- #thinking? ⇒ Boolean
Constructor Details
#initialize(text: nil, thinking: nil) ⇒ Delta
Returns a new instance of Delta.
18 19 20 21 |
# File 'lib/omniai/chat/delta.rb', line 18 def initialize(text: nil, thinking: nil) @text = text @thinking = thinking end |
Instance Attribute Details
#text ⇒ String?
10 11 12 |
# File 'lib/omniai/chat/delta.rb', line 10 def text @text end |
#thinking ⇒ String?
14 15 16 |
# File 'lib/omniai/chat/delta.rb', line 14 def thinking @thinking end |
Instance Method Details
#text? ⇒ Boolean
24 25 26 |
# File 'lib/omniai/chat/delta.rb', line 24 def text? !@text.nil? && !@text.empty? end |
#thinking? ⇒ Boolean
29 30 31 |
# File 'lib/omniai/chat/delta.rb', line 29 def thinking? !@thinking.nil? && !@thinking.empty? end |