class Riffer::StreamEvents::Base
Base class for all streaming events in the Riffer framework.
Subclasses must implement the +to_h+ method.
Attributes
The message role (typically :assistant).
Public Class Methods
Source
# File lib/riffer/stream_events/base.rb, line 12 def initialize(role: :assistant) @role = role end
: (?role: Symbol) -> void
Public Instance Methods
Source
# File lib/riffer/stream_events/base.rb, line 21 def to_h raise NotImplementedError, "Subclasses must implement #to_h" end
Converts the event to a hash.
Raises NotImplementedError if not implemented by subclass.
: () -> Hash[Symbol, untyped]