FIX: hardcoded require for evals (#1137)

The require for `discourse/config/environment` should point to the local user's core Discourse environment instead of the hardcoded path for Sam's env.
This commit is contained in:
Keegan George 2025-02-19 11:56:52 -08:00 committed by GitHub
parent 37bf160d26
commit af47873f28
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,12 +24,12 @@ if !Dir.exist?(EVAL_PATH)
end
end
discourse_path = File.expand_path(File.join(__dir__, "../../../.."))
discourse_path = ENV["DISCOURSE_PATH"] || File.expand_path(File.join(__dir__, "../../../.."))
# rubocop:disable Discourse/NoChdir
Dir.chdir(discourse_path)
# rubocop:enable Discourse/NoChdir
require "/home/sam/Source/discourse/config/environment"
require "#{discourse_path}/config/environment"
ENV["DISCOURSE_AI_NO_DEBUG"] = "1"
module DiscourseAi::Evals