module RubyLLM::ActiveRecord::ChunkMethods
Gives each RubyLLM::Chunk streamed from a persisted chat the message record it streams into.
chat.ask("Tell me a story", &:broadcast)
Attributes
Returns the persisted message record this chunk streams into.
Public Instance Methods
Source
# File lib/ruby_llm/active_record/chunk_methods.rb, line 33 def broadcast raise RubyLLM::ConfigurationError, BROADCASTING_OFF unless message.respond_to?(:broadcast_chunk) message.broadcast_chunk(self) end
Appends this chunk to its message on the chatβs page. See MessageBroadcasting#broadcast_chunk. Raises RubyLLM::ConfigurationError when the message does not broadcast.