module RubyLLM::ActiveRecord::ChatMethods

ChatMethods provides the RubyLLM::Chat API on ActiveRecord models declared with acts_as_chat, persisting every message to the database. Configuration methods return self so calls can be chained.

class Chat < ApplicationRecord
  acts_as_chat
end

chat = Chat.create!(model: 'gpt-5-nano')
chat.ask "What is the capital of France?"
chat.messages.count # => 2