Roman Rizzi 71b105a1bb
FEATURE: Introduce the ai-bot module (#52)
This module lets you chat with our GPT bot inside a PM. The bot only replies to members of the groups listed on the ai_bot_allowed_groups setting and only if you invite it to participate in the PM.
2023-05-05 15:28:31 -03:00

20 lines
422 B
Ruby

# frozen_string_literal: true
module DiscourseAi
module AiBot
class BotController < ::ApplicationController
requires_plugin ::DiscourseAi::PLUGIN_NAME
requires_login
def stop_streaming_response
post = Post.find(params[:post_id])
guardian.ensure_can_see!(post)
Discourse.redis.del("gpt_cancel:#{post.id}")
render json: {}, status: 200
end
end
end
end