Module: RubyLLM::ActiveRecord::ChatMethods
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/ruby_llm/active_record/acts_as.rb
Overview
Methods mixed into chat models to handle message persistence and provide a conversation interface.
Instance Method Summary collapse
- #ask(message, &block) ⇒ Object (also: #say)
- #chat ⇒ Object
Instance Method Details
#ask(message, &block) ⇒ Object Also known as: say
51 52 53 54 55 |
# File 'lib/ruby_llm/active_record/acts_as.rb', line 51 def ask(, &block) = { role: :user, content: } .create!(**) chat.complete(&block) end |