Class: Riffer::StreamEvents::TextDelta

Inherits:
Base
  • Object
show all
Defined in:
lib/riffer/stream_events/text_delta.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#role

Instance Method Summary collapse

Constructor Details

#initialize(content, role: "assistant") ⇒ TextDelta

Returns a new instance of TextDelta.



6
7
8
9
# File 'lib/riffer/stream_events/text_delta.rb', line 6

def initialize(content, role: "assistant")
  super(role: role)
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



4
5
6
# File 'lib/riffer/stream_events/text_delta.rb', line 4

def content
  @content
end

Instance Method Details

#to_hObject



11
12
13
# File 'lib/riffer/stream_events/text_delta.rb', line 11

def to_h
  {role: @role, content: @content}
end