DEV: Hide soon to be deprecated modules settings (#872)
This commit is contained in:
parent
945f04b089
commit
820b506910
|
@ -6,8 +6,9 @@ discourse_ai:
|
|||
ai_toxicity_enabled:
|
||||
default: false
|
||||
client: true
|
||||
hidden: true
|
||||
ai_toxicity_inference_service_api_endpoint:
|
||||
default: "https://disorder-testing.demo-by-discourse.com"
|
||||
default: ""
|
||||
ai_toxicity_inference_service_api_endpoint_srv:
|
||||
default: ""
|
||||
hidden: true
|
||||
|
@ -72,9 +73,11 @@ discourse_ai:
|
|||
- sentiment
|
||||
- emotion
|
||||
|
||||
ai_nsfw_detection_enabled: false
|
||||
ai_nsfw_detection_enabled:
|
||||
default: false
|
||||
hidden: true
|
||||
ai_nsfw_inference_service_api_endpoint:
|
||||
default: "https://nsfw-testing.demo-by-discourse.com"
|
||||
default: ""
|
||||
ai_nsfw_inference_service_api_endpoint_srv:
|
||||
default: ""
|
||||
hidden: true
|
||||
|
|
|
@ -7,6 +7,7 @@ describe Jobs::ToxicityClassifyChatMessage do
|
|||
before do
|
||||
SiteSetting.ai_toxicity_enabled = true
|
||||
SiteSetting.ai_toxicity_flag_automatically = true
|
||||
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
|
||||
end
|
||||
|
||||
fab!(:chat_message)
|
||||
|
|
|
@ -8,6 +8,7 @@ describe Jobs::ToxicityClassifyPost do
|
|||
before do
|
||||
SiteSetting.ai_toxicity_enabled = true
|
||||
SiteSetting.ai_toxicity_flag_automatically = true
|
||||
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
|
||||
end
|
||||
|
||||
fab!(:post)
|
||||
|
|
|
@ -5,6 +5,8 @@ require_relative "../../../support/toxicity_inference_stubs"
|
|||
describe DiscourseAi::Toxicity::ToxicityClassification do
|
||||
fab!(:target) { Fabricate(:post) }
|
||||
|
||||
before { SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com" }
|
||||
|
||||
describe "#request" do
|
||||
it "returns the classification and the model used for it" do
|
||||
ToxicityInferenceStubs.stub_post_classification(target, toxic: false)
|
||||
|
|
|
@ -3,7 +3,10 @@
|
|||
require_relative "support/toxicity_inference_stubs"
|
||||
|
||||
describe Plugin::Instance do
|
||||
before { SiteSetting.discourse_ai_enabled = true }
|
||||
before do
|
||||
SiteSetting.discourse_ai_enabled = true
|
||||
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
|
||||
end
|
||||
|
||||
describe "on reviewable_transitioned_to event" do
|
||||
fab!(:post)
|
||||
|
|
|
@ -8,6 +8,8 @@ describe DiscourseAi::ChatMessageClassificator do
|
|||
let(:model) { DiscourseAi::Toxicity::ToxicityClassification.new }
|
||||
let(:classification) { described_class.new(model) }
|
||||
|
||||
before { SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com" }
|
||||
|
||||
describe "#classify!" do
|
||||
before { ToxicityInferenceStubs.stub_chat_message_classification(chat_message, toxic: true) }
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@ describe DiscourseAi::PostClassificator do
|
|||
let(:model) { DiscourseAi::Toxicity::ToxicityClassification.new }
|
||||
let(:classification) { described_class.new(model) }
|
||||
|
||||
before { SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com" }
|
||||
|
||||
describe "#classify!" do
|
||||
before { ToxicityInferenceStubs.stub_post_classification(post, toxic: true) }
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ RSpec.describe "Toxicity-flagged chat messages", type: :system, js: true do
|
|||
sign_in(admin)
|
||||
SiteSetting.ai_toxicity_enabled = true
|
||||
SiteSetting.ai_toxicity_flag_automatically = true
|
||||
SiteSetting.ai_toxicity_inference_service_api_endpoint = "http://example.com"
|
||||
|
||||
ToxicityInferenceStubs.stub_chat_message_classification(chat_message, toxic: true)
|
||||
|
||||
|
|
Loading…
Reference in New Issue