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)
- #to_llm ⇒ Object
Instance Method Details
#ask(message, &block) ⇒ Object Also known as: say
59 60 61 62 63 |
# File 'lib/ruby_llm/active_record/acts_as.rb', line 59 def ask(, &block) = { role: :user, content: } .create!(**) chat.complete(&block) end |