Module: RubyLLM::ActiveRecord::MessageMethods

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

Overview

Methods for LLM message handling

Instance Method Summary collapse

Instance Method Details

#to_llm_formatObject



95
96
97
98
99
100
101
102
# File 'lib/ruby_llm/active_record/acts_as.rb', line 95

def to_llm_format
  RubyLLM::Message.new(
    role: role.to_sym,
    content: content,
    tool_calls: tool_calls,
    tool_results: tool_results
  )
end