mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-28 06:19:25 +00:00
We'll create one bot user for each available model. When listed in the `ai_bot_enabled_chat_bots` setting, they will reply. This PR lets us use Claude-v1 in stream mode.
16 lines
390 B
Ruby
16 lines
390 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ::Jobs
|
|
class CreateAiReply < ::Jobs::Base
|
|
sidekiq_options retry: false
|
|
|
|
def execute(args)
|
|
return unless bot_user = User.find_by(id: args[:bot_user_id])
|
|
return unless bot = DiscourseAi::AiBot::Bot.as(bot_user)
|
|
return unless post = Post.includes(:topic).find_by(id: args[:post_id])
|
|
|
|
bot.reply_to(post)
|
|
end
|
|
end
|
|
end
|