Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gemfiles/ruby_llm_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ eval_gemfile "rails8.gemfile"

# Keep the 1.x adapter covered while the other jobs resolve RubyLLM 2.x.
gem "ruby_llm", "~> 1.16"

# ruby_llm 1.x depends on faraday-net_http directly, and every recent Faraday
# requires faraday-net_http < 3.5, so once 3.5.0 shipped Bundler fell back to
# Faraday 2.0.0, which registers no :net_http adapter. A floor keeps a
# Faraday that can make requests.
gem "faraday", ">= 2.7"
15 changes: 11 additions & 4 deletions test/evals/support/ruby_llm_conversation_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,22 @@ def replay_json(messages)
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Migration.verbose = false

# RubyLLM's railtie requires these under Rails; a release that renames one
# reads as a skip naming the file rather than a crash.
# RubyLLM's railtie requires these under Rails, in its order; a release
# that renames one reads as a skip naming the file rather than a crash.
# 2.1 added record (the base class its models inherit from), mcp_credential
# and provider_file; they are required where the release has them.
internals = if V2
%w[payload_helpers model tool_call usage batch chat_methods message_methods acts_as]
%w[record payload_helpers model tool_call usage batch mcp_credential provider_file chat_methods message_methods acts_as]
else
%w[payload_helpers chat_methods message_methods model_methods tool_call_methods acts_as]
end
since_2_1 = %w[record mcp_credential provider_file]
begin
internals.each { |file| require "ruby_llm/active_record/#{file}" }
internals.each do |file|
next if since_2_1.include?(file) && $LOAD_PATH.none? { |dir| File.exist?(File.join(dir, "ruby_llm/active_record/#{file}.rb")) }

require "ruby_llm/active_record/#{file}"
end
rescue LoadError => e
output["records"] = { "skipped" => "ruby_llm #{RubyLLM::VERSION}: #{e.message}" }
puts JSON.generate(output)
Expand Down
Loading