Class: RubyLLM::Evals::PerformRunJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- RubyLLM::Evals::PerformRunJob
- Defined in:
- app/jobs/ruby_llm/evals/perform_run_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(prompt_id:) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/jobs/ruby_llm/evals/perform_run_job.rb', line 6 def perform(prompt_id:) prompt = Prompt.find prompt_id run = prompt.runs.create active_job_id: job_id, started_at: Time.current if prompt.samples.any? prompt.samples.each do |sample| ExecuteSampleJob.perform_later(run_id: run.id, sample_id: sample.id) end else run.update ended_at: Time.current end end |