Module: RubyLLM::ActiveRecord::ConversationMethods

Extended by:
ActiveSupport::Concern
Defined in:
lib/ruby_llm/active_record/acts_as.rb

Overview

Methods for LLM conversation handling

Instance Method Summary collapse

Instance Method Details

#send_message(content, model: nil) ⇒ Object



46
47
48
49
50
51
# File 'lib/ruby_llm/active_record/acts_as.rb', line 46

def send_message(content, model: nil)
  transaction do
    create_user_message(content)
    create_assistant_response(model)
  end
end