DEV: Update linting (#423)
Co-authored-by: Keegan George <[email protected]>
This commit is contained in:
co-authored by
Keegan George
parent
1748ebcb8c
commit
6b8a57d957
+14
-19
@@ -2,18 +2,18 @@ GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
ast (2.4.2)
|
||||
json (2.6.3)
|
||||
json (2.7.1)
|
||||
language_server-protocol (3.17.0.3)
|
||||
parallel (1.23.0)
|
||||
parser (3.2.2.4)
|
||||
parallel (1.24.0)
|
||||
parser (3.3.0.3)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
prettier_print (1.2.1)
|
||||
racc (1.7.3)
|
||||
rainbow (3.1.1)
|
||||
regexp_parser (2.8.2)
|
||||
regexp_parser (2.9.0)
|
||||
rexml (3.2.6)
|
||||
rubocop (1.57.2)
|
||||
rubocop (1.59.0)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (>= 3.17.0)
|
||||
parallel (~> 1.10)
|
||||
@@ -21,19 +21,19 @@ GEM
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rubocop-ast (>= 1.28.1, < 2.0)
|
||||
rubocop-ast (>= 1.30.0, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 3.0)
|
||||
rubocop-ast (1.30.0)
|
||||
parser (>= 3.2.1.0)
|
||||
rubocop-capybara (2.19.0)
|
||||
rubocop-capybara (2.20.0)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-discourse (3.4.1)
|
||||
rubocop (>= 1.1.0)
|
||||
rubocop-rspec (>= 2.0.0)
|
||||
rubocop-factory_bot (2.24.0)
|
||||
rubocop (~> 1.33)
|
||||
rubocop-rspec (2.25.0)
|
||||
rubocop-discourse (3.6.0)
|
||||
rubocop (>= 1.59.0)
|
||||
rubocop-rspec (>= 2.25.0)
|
||||
rubocop-factory_bot (2.25.1)
|
||||
rubocop (~> 1.41)
|
||||
rubocop-rspec (2.26.1)
|
||||
rubocop (~> 1.40)
|
||||
rubocop-capybara (~> 2.17)
|
||||
rubocop-factory_bot (~> 2.22)
|
||||
@@ -43,16 +43,11 @@ GEM
|
||||
unicode-display_width (2.5.0)
|
||||
|
||||
PLATFORMS
|
||||
arm64-darwin-20
|
||||
ruby
|
||||
x86_64-darwin-18
|
||||
x86_64-darwin-19
|
||||
x86_64-darwin-20
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
rubocop-discourse
|
||||
syntax_tree
|
||||
|
||||
BUNDLED WITH
|
||||
2.4.13
|
||||
2.5.4
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
<div class="sidebar-hamburger-dropdown">
|
||||
{{#each this.botNames as |bot|}}
|
||||
<DButton
|
||||
@class="btn-flat ai-bot-available-bot-content"
|
||||
@translatedTitle={{bot.humanized}}
|
||||
@translatedLabel={{bot.humanized}}
|
||||
@action={{action "composeMessageWithTargetBot" bot.modelName}}
|
||||
class="btn-flat ai-bot-available-bot-content"
|
||||
/>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { Input } from "@ember/component";
|
||||
import { fn } from "@ember/helper";
|
||||
import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import DButton from "discourse/components/d-button";
|
||||
@@ -8,27 +9,6 @@ import i18n from "discourse-common/helpers/i18n";
|
||||
import not from "truth-helpers/helpers/not";
|
||||
|
||||
export default class AiHelperCustomPrompt extends Component {
|
||||
<template>
|
||||
<div class="ai-custom-prompt" {{didInsert this.setupCustomPrompt}}>
|
||||
<Input
|
||||
@value={{@value}}
|
||||
placeholder={{i18n
|
||||
"discourse_ai.ai_helper.context_menu.custom_prompt.placeholder"
|
||||
}}
|
||||
class="ai-custom-prompt__input"
|
||||
@enter={{this.sendInput}}
|
||||
/>
|
||||
|
||||
<DButton
|
||||
@class="ai-custom-prompt__submit btn-primary"
|
||||
@icon="discourse-sparkles"
|
||||
@action={{@submit}}
|
||||
@actionParam={{@promptArgs}}
|
||||
@disabled={{not @value.length}}
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@tracked _customPromptInput;
|
||||
|
||||
@action
|
||||
@@ -43,4 +23,24 @@ export default class AiHelperCustomPrompt extends Component {
|
||||
sendInput() {
|
||||
return this.args.submit(this.args.promptArgs);
|
||||
}
|
||||
|
||||
<template>
|
||||
<div class="ai-custom-prompt" {{didInsert this.setupCustomPrompt}}>
|
||||
<Input
|
||||
@value={{@value}}
|
||||
placeholder={{i18n
|
||||
"discourse_ai.ai_helper.context_menu.custom_prompt.placeholder"
|
||||
}}
|
||||
class="ai-custom-prompt__input"
|
||||
@enter={{this.sendInput}}
|
||||
/>
|
||||
|
||||
<DButton
|
||||
@icon="discourse-sparkles"
|
||||
@action={{fn @submit @promptArgs}}
|
||||
@disabled={{not @value.length}}
|
||||
class="ai-custom-prompt__submit btn-primary"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Input } from "@ember/component";
|
||||
|
||||
<template>
|
||||
const AiPersonaCommandOptionEditor = <template>
|
||||
<div class="control-group ai-persona-command-option-editor">
|
||||
<label>
|
||||
{{@option.name}}
|
||||
@@ -12,4 +12,6 @@ import { Input } from "@ember/component";
|
||||
{{@option.description}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>;
|
||||
|
||||
export default AiPersonaCommandOptionEditor;
|
||||
|
||||
@@ -14,9 +14,11 @@ import eq from "truth-helpers/helpers/eq";
|
||||
export default class AiSplitTopicSuggester extends Component {
|
||||
@service site;
|
||||
@service menu;
|
||||
|
||||
@tracked suggestions = [];
|
||||
@tracked loading = false;
|
||||
@tracked icon = "discourse-sparkles";
|
||||
|
||||
SUGGESTION_TYPES = {
|
||||
title: "suggest_title",
|
||||
category: "suggest_category",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { fn } from "@ember/helper";
|
||||
import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import { inject as service } from "@ember/service";
|
||||
@@ -13,12 +14,14 @@ export default class AISuggestionDropdown extends Component {
|
||||
@service dialog;
|
||||
@service siteSettings;
|
||||
@service composer;
|
||||
|
||||
@tracked loading = false;
|
||||
@tracked showMenu = false;
|
||||
@tracked generatedSuggestions = [];
|
||||
@tracked suggestIcon = "discourse-sparkles";
|
||||
@tracked showErrors = false;
|
||||
@tracked error = "";
|
||||
|
||||
SUGGESTION_TYPES = {
|
||||
title: "suggest_title",
|
||||
category: "suggest_category",
|
||||
@@ -213,11 +216,11 @@ export default class AISuggestionDropdown extends Component {
|
||||
<template>
|
||||
{{#if this.showAIButton}}
|
||||
<DButton
|
||||
@class="suggestion-button {{if this.loading 'is-loading'}}"
|
||||
@icon={{this.suggestIcon}}
|
||||
@title="discourse_ai.ai_helper.suggest"
|
||||
@action={{this.performSuggestion}}
|
||||
@disabled={{this.disableSuggestionButton}}
|
||||
class="suggestion-button {{if this.loading 'is-loading'}}"
|
||||
...attributes
|
||||
/>
|
||||
{{/if}}
|
||||
@@ -234,10 +237,9 @@ export default class AISuggestionDropdown extends Component {
|
||||
{{#each this.generatedSuggestions as |suggestion index|}}
|
||||
<li data-name={{suggestion}} data-value={{index}}>
|
||||
<DButton
|
||||
@class="popup-menu-btn"
|
||||
@translatedLabel={{suggestion}}
|
||||
@action={{this.applySuggestion}}
|
||||
@actionParam={{suggestion}}
|
||||
@action={{fn this.applySuggestion suggestion}}
|
||||
class="popup-menu-btn"
|
||||
/>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
||||
@@ -3,9 +3,7 @@ import { action } from "@ember/object";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import DModal from "discourse/components/d-modal";
|
||||
import I18n from "I18n";
|
||||
|
||||
const t = I18n.t.bind(I18n);
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
|
||||
export default class ModalDiffModal extends Component {
|
||||
@action
|
||||
@@ -23,7 +21,7 @@ export default class ModalDiffModal extends Component {
|
||||
<template>
|
||||
<DModal
|
||||
class="composer-ai-helper-modal"
|
||||
@title={{t "discourse_ai.ai_helper.context_menu.changes"}}
|
||||
@title={{i18n "discourse_ai.ai_helper.context_menu.changes"}}
|
||||
@closeModal={{@closeModal}}
|
||||
>
|
||||
<:body>
|
||||
|
||||
@@ -6,12 +6,11 @@ import { action } from "@ember/object";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import DButton from "discourse/components/d-button";
|
||||
import DModal from "discourse/components/d-modal";
|
||||
import i18n from "discourse-common/helpers/i18n";
|
||||
import discourseLater from "discourse-common/lib/later";
|
||||
import I18n from "I18n";
|
||||
import I18n from "discourse-i18n";
|
||||
import copyConversation from "../../lib/copy-conversation";
|
||||
|
||||
const t = I18n.t.bind(I18n);
|
||||
|
||||
export default class ShareModal extends Component {
|
||||
@tracked contextValue = 1;
|
||||
@tracked htmlContext = "";
|
||||
@@ -63,8 +62,10 @@ export default class ShareModal extends Component {
|
||||
const from =
|
||||
this.allPosts[this.allPosts.length - this.contextValue * 2].post_number;
|
||||
const to = this.args.model.post_number;
|
||||
|
||||
await copyConversation(this.args.model.topic, from, to);
|
||||
this.justCopiedText = t("discourse_ai.ai_bot.conversation_shared");
|
||||
this.justCopiedText = I18n.t("discourse_ai.ai_bot.conversation_shared");
|
||||
|
||||
discourseLater(() => {
|
||||
this.justCopiedText = "";
|
||||
}, 2000);
|
||||
@@ -73,7 +74,7 @@ export default class ShareModal extends Component {
|
||||
<template>
|
||||
<DModal
|
||||
class="ai-share-modal"
|
||||
@title={{t "discourse_ai.ai_bot.share_modal.title"}}
|
||||
@title={{i18n "discourse_ai.ai_bot.share_modal.title"}}
|
||||
@closeModal={{@closeModal}}
|
||||
>
|
||||
<:body>
|
||||
@@ -92,7 +93,7 @@ export default class ShareModal extends Component {
|
||||
{{on "change" this.updateHtmlContext}}
|
||||
/>
|
||||
<div class="ai-share-modal__context">
|
||||
{{t "discourse_ai.ai_bot.share_modal.context"}}
|
||||
{{i18n "discourse_ai.ai_bot.share_modal.context"}}
|
||||
{{this.contextValue}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { fn } from "@ember/helper";
|
||||
import { action } from "@ember/object";
|
||||
import DButton from "discourse/components/d-button";
|
||||
|
||||
@@ -26,11 +27,10 @@ export default class ThumbnailSuggestionItem extends Component {
|
||||
<template>
|
||||
<div class="ai-thumbnail-suggestions__item">
|
||||
<DButton
|
||||
class={{if this.selected "btn-primary" ""}}
|
||||
@icon={{this.selectIcon}}
|
||||
@label={{this.selectLabel}}
|
||||
@action={{this.toggleSelection}}
|
||||
@actionParam={{@thumbnail}}
|
||||
@action={{fn this.toggleSelection @thumbnail}}
|
||||
class={{if this.selected "btn-primary"}}
|
||||
/>
|
||||
<img
|
||||
src={{@thumbnail.url}}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import { inject as service } from "@ember/service";
|
||||
import AISuggestionDropdown from "../../components/ai-suggestion-dropdown";
|
||||
import { showComposerAIHelper } from "../../lib/show-ai-helper";
|
||||
|
||||
export default class AICategorySuggestion extends Component {
|
||||
export default class AiCategorySuggestion extends Component {
|
||||
static shouldRender(outletArgs, helper) {
|
||||
return showComposerAIHelper(outletArgs, helper);
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import { inject as service } from "@ember/service";
|
||||
import AISuggestionDropdown from "../../components/ai-suggestion-dropdown";
|
||||
import { showComposerAIHelper } from "../../lib/show-ai-helper";
|
||||
|
||||
export default class AITagSuggestion extends Component {
|
||||
export default class AiTagSuggestion extends Component {
|
||||
static shouldRender(outletArgs, helper) {
|
||||
return showComposerAIHelper(outletArgs, helper);
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import Component from "@glimmer/component";
|
||||
import AISuggestionDropdown from "../../components/ai-suggestion-dropdown";
|
||||
import { showComposerAIHelper } from "../../lib/show-ai-helper";
|
||||
|
||||
export default class AITitleSuggestion extends Component {
|
||||
export default class AiTitleSuggestion extends Component {
|
||||
static shouldRender(outletArgs, helper) {
|
||||
return showComposerAIHelper(outletArgs, helper);
|
||||
}
|
||||
|
||||
@@ -26,10 +26,9 @@
|
||||
<li data-name={{option.translated_name}} data-value={{option.id}}>
|
||||
<DButton
|
||||
@icon={{option.icon}}
|
||||
@class="btn-flat"
|
||||
@translatedLabel={{option.translated_name}}
|
||||
@action={{this.updateSelected}}
|
||||
@actionParam={{option}}
|
||||
@action={{fn this.updateSelected option}}
|
||||
class="btn-flat"
|
||||
/>
|
||||
</li>
|
||||
{{/if}}
|
||||
@@ -81,8 +80,7 @@
|
||||
<DButton
|
||||
@icon="discourse-sparkles"
|
||||
@label="discourse_ai.ai_helper.context_menu.regen"
|
||||
@action={{this.updateSelected}}
|
||||
@actionParam={{this.lastUsedOption}}
|
||||
@action={{fn this.updateSelected this.lastUsedOption}}
|
||||
class="btn-flat"
|
||||
/>
|
||||
</li>
|
||||
|
||||
+8
-6
@@ -1,5 +1,6 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { fn } from "@ember/helper";
|
||||
import { action } from "@ember/object";
|
||||
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
|
||||
import willDestroy from "@ember/render-modifiers/modifiers/will-destroy";
|
||||
@@ -22,12 +23,14 @@ export default class AIHelperOptionsMenu extends Component {
|
||||
static shouldRender(outletArgs, helper) {
|
||||
return showPostAIHelper(outletArgs, helper);
|
||||
}
|
||||
|
||||
@service messageBus;
|
||||
@service site;
|
||||
@service modal;
|
||||
@service siteSettings;
|
||||
@service currentUser;
|
||||
@service menu;
|
||||
|
||||
@tracked helperOptions = [];
|
||||
@tracked menuState = this.MENU_STATES.triggers;
|
||||
@tracked loading = false;
|
||||
@@ -215,11 +218,11 @@ export default class AIHelperOptionsMenu extends Component {
|
||||
<div class="ai-post-helper">
|
||||
{{#if (eq this.menuState this.MENU_STATES.triggers)}}
|
||||
<DButton
|
||||
@class="btn-flat ai-post-helper__trigger"
|
||||
@icon="discourse-sparkles"
|
||||
@title="discourse_ai.ai_helper.post_options_menu.title"
|
||||
@label="discourse_ai.ai_helper.post_options_menu.trigger"
|
||||
@action={{this.showAIHelperOptions}}
|
||||
class="btn-flat ai-post-helper__trigger"
|
||||
/>
|
||||
|
||||
{{else if (eq this.menuState this.MENU_STATES.options)}}
|
||||
@@ -233,13 +236,12 @@ export default class AIHelperOptionsMenu extends Component {
|
||||
/>
|
||||
{{else}}
|
||||
<DButton
|
||||
@class="btn-flat ai-post-helper__options-button"
|
||||
@icon={{option.icon}}
|
||||
@translatedLabel={{option.translated_name}}
|
||||
@action={{this.performAISuggestion}}
|
||||
@actionParam={{option}}
|
||||
@action={{fn this.performAISuggestion option}}
|
||||
data-name={{option.name}}
|
||||
data-value={{option.id}}
|
||||
class="btn-flat ai-post-helper__options-button"
|
||||
/>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
@@ -259,17 +261,17 @@ export default class AIHelperOptionsMenu extends Component {
|
||||
</div>
|
||||
<di class="ai-post-helper__suggestion__buttons">
|
||||
<DButton
|
||||
@class="btn-flat ai-post-helper__suggestion__cancel"
|
||||
@icon="times"
|
||||
@label="discourse_ai.ai_helper.post_options_menu.cancel"
|
||||
@action={{this.cancelAIAction}}
|
||||
class="btn-flat ai-post-helper__suggestion__cancel"
|
||||
/>
|
||||
<DButton
|
||||
@class="btn-flat ai-post-helper__suggestion__copy"
|
||||
@icon={{this.copyButtonIcon}}
|
||||
@label={{this.copyButtonLabel}}
|
||||
@action={{this.copySuggestion}}
|
||||
@disabled={{not this.suggestion}}
|
||||
class="btn-flat ai-post-helper__suggestion__copy"
|
||||
/>
|
||||
</di>
|
||||
{{else}}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { inject as service } from "@ember/service";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service("router"),
|
||||
router: service(),
|
||||
beforeModel() {
|
||||
this.router.transitionTo("adminPlugins.discourse-ai.ai-personas");
|
||||
},
|
||||
|
||||
@@ -9,7 +9,7 @@ module DiscourseAi
|
||||
|
||||
def self.endpoint_for(model_name)
|
||||
# Order is important.
|
||||
# Bedrock has priority over Anthropic if creadentials are present.
|
||||
# Bedrock has priority over Anthropic if credentials are present.
|
||||
endpoints = [
|
||||
DiscourseAi::Completions::Endpoints::AwsBedrock,
|
||||
DiscourseAi::Completions::Endpoints::Anthropic,
|
||||
@@ -284,8 +284,8 @@ module DiscourseAi
|
||||
&.elements
|
||||
.to_a
|
||||
.each do |elem|
|
||||
if paramenter = function_buffer.at(elem.name)&.text
|
||||
function_buffer.at(elem.name).inner_html = paramenter
|
||||
if parameter = function_buffer.at(elem.name)&.text
|
||||
function_buffer.at(elem.name).inner_html = parameter
|
||||
else
|
||||
param_node = read_function.at(elem.name)
|
||||
function_buffer.at("parameters").add_child(param_node)
|
||||
|
||||
@@ -6,7 +6,7 @@ module ::DiscourseAi
|
||||
def self.perform!(content, model = nil)
|
||||
headers = { "Content-Type" => "application/json" }
|
||||
|
||||
if SiteSetting.ai_openai_embeddings_url.include? ("azure")
|
||||
if SiteSetting.ai_openai_embeddings_url.include?("azure")
|
||||
headers["api-key"] = SiteSetting.ai_openai_api_key
|
||||
else
|
||||
headers["Authorization"] = "Bearer #{SiteSetting.ai_openai_api_key}"
|
||||
|
||||
+2
-4
@@ -1,12 +1,10 @@
|
||||
{
|
||||
"name": "discourse-ai",
|
||||
"private": true,
|
||||
"author": "Discourse",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@discourse/lint-configs": "^1.2.0",
|
||||
"@discourse/lint-configs": "^1.3.4",
|
||||
"ember-template-lint": "^5.13.0",
|
||||
"eslint": "^8.54.0",
|
||||
"eslint": "^8.56.0",
|
||||
"prettier": "^2.8.8"
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -53,6 +53,8 @@ RSpec.describe Jobs::StreamPostHelper do
|
||||
explanation =
|
||||
"In this context, \"pie\" refers to a baked dessert typically consisting of a pastry crust and filling."
|
||||
|
||||
partial_explanation = "I"
|
||||
|
||||
DiscourseAi::Completions::Llm.with_prepared_responses([explanation]) do
|
||||
messages =
|
||||
MessageBus.track_publish("/discourse-ai/ai-helper/explain/#{post.id}") do
|
||||
@@ -61,7 +63,7 @@ RSpec.describe Jobs::StreamPostHelper do
|
||||
|
||||
partial_result_update = messages.first.data
|
||||
expect(partial_result_update[:done]).to eq(false)
|
||||
expect(partial_result_update[:result]).to eq(explanation)
|
||||
expect(partial_result_update[:result]).to eq(partial_explanation)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -76,6 +78,7 @@ RSpec.describe Jobs::StreamPostHelper do
|
||||
end
|
||||
|
||||
final_update = messages.last.data
|
||||
expect(final_update[:result]).to eq(explanation)
|
||||
expect(final_update[:done]).to eq(true)
|
||||
end
|
||||
end
|
||||
@@ -30,7 +30,7 @@ RSpec.describe DiscourseAi::AiBot::Tools::Search do
|
||||
before { SiteSetting.ai_bot_enabled = true }
|
||||
|
||||
describe "#invoke" do
|
||||
it "can retreive options from persona correctly" do
|
||||
it "can retrieve options from persona correctly" do
|
||||
persona_options = { "base_query" => "#funny" }
|
||||
|
||||
search_post = Fabricate(:post, topic: topic_with_tags)
|
||||
@@ -61,9 +61,7 @@ RSpec.describe DiscourseAi::AiBot::Tools::Search do
|
||||
end
|
||||
|
||||
describe "semantic search" do
|
||||
let (:query) {
|
||||
"this is an expanded search"
|
||||
}
|
||||
let(:query) { "this is an expanded search" }
|
||||
after { DiscourseAi::Embeddings::SemanticSearch.clear_cache_for(query) }
|
||||
|
||||
it "supports semantic search when enabled" do
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
module DiscourseAi
|
||||
module Automation
|
||||
describe ReportContextGenerator do
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe DiscourseAi::Embeddings::EntryPoint do
|
||||
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe DiscourseAi::Embeddings::SemanticRelated do
|
||||
subject(:semantic_related) { described_class.new }
|
||||
|
||||
@@ -19,9 +17,7 @@ describe DiscourseAi::Embeddings::SemanticRelated do
|
||||
|
||||
describe "#related_topic_ids_for" do
|
||||
context "when embeddings do not exist" do
|
||||
let (:topic) do
|
||||
Fabricate(:topic).tap { described_class.clear_cache_for(target) }
|
||||
end
|
||||
let(:topic) { Fabricate(:topic).tap { described_class.clear_cache_for(target) } }
|
||||
|
||||
it "queues job only once per 15 minutes" do
|
||||
results = nil
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe DiscourseAi::Embeddings::EntryPoint do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe DiscourseAi::Nsfw::EntryPoint do
|
||||
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
require_relative "../../../../../support/nsfw_inference_stubs"
|
||||
|
||||
describe Jobs::EvaluatePostUploads do
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
require_relative "../../../../../support/sentiment_inference_stubs"
|
||||
|
||||
describe Jobs::PostSentimentAnalysis do
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
require_relative "../../../support/sentiment_inference_stubs"
|
||||
|
||||
describe DiscourseAi::Sentiment::SentimentClassification do
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
|
||||
describe DiscourseAi::Toxicity::EntryPoint do
|
||||
fab!(:user) { Fabricate(:user, refresh_auto_groups: true) }
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rails_helper"
|
||||
require_relative "../../../../../support/toxicity_inference_stubs"
|
||||
|
||||
describe Jobs::ToxicityClassifyChatMessage do
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user