mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-08-07 13:43:57 +00:00
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.
20 lines
422 B
Ruby
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
|