iachat/enterprise/app/jobs/captain/llm/update_embedding_job.rb
2025-12-11 14:17:28 +05:30

10 lines
288 B
Ruby

class Captain::Llm::UpdateEmbeddingJob < ApplicationJob
queue_as :low
def perform(record, content)
account_id = record.account_id
embedding = Captain::Llm::EmbeddingService.new(account_id: account_id).get_embedding(content)
record.update!(embedding: embedding)
end
end