Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf8b3a4b40 |
@@ -0,0 +1,8 @@
|
|||||||
|
< 3.3.0.beta2-dev: 61890b667c06299841ae88946f84a112f00060e1
|
||||||
|
< 3.3.0.beta1-dev: a65c4076a63104b61d213534db7f89aa3c8acd9e
|
||||||
|
< 3.2.0.beta5-dev: c70f43f130fb98e4a1adb1afd9b621aaa49088e3
|
||||||
|
< 3.2.0.beta4-dev: 493b48477a9288f2f1b6f021954088705a6673d6
|
||||||
|
< 3.2.0.beta2-dev: 3bced1c6f525553fe2b5b79d29bd66c1cf2a47d5
|
||||||
|
3.1.999: c0415bb7eb878b1b7abf112d65cba981030df8df
|
||||||
|
< 3.2.0.beta1-dev: 3e7c99de894b03e9161d9481da118fe893991a1d
|
||||||
|
3.1.0.beta3: 057fbe1ce6
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require("@discourse/lint-configs/eslint");
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
name: Discourse Plugin
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
uses: discourse/.github/.github/workflows/discourse-plugin.yml@v1
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
node_modules
|
||||||
|
/gems
|
||||||
|
/auto_generated
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
app/assets/stylesheets/vendor/
|
||||||
|
documentation/
|
||||||
|
package.json
|
||||||
|
config/locales/**/*.yml
|
||||||
|
!config/locales/**/*.en*.yml
|
||||||
|
script/import_scripts/**/*.yml
|
||||||
|
|
||||||
|
plugins/**/lib/javascripts/locale
|
||||||
|
public/
|
||||||
|
!/app/assets/javascripts/discourse/public
|
||||||
|
vendor/
|
||||||
|
app/assets/javascripts/discourse/tests/fixtures
|
||||||
|
spec/
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
tmp/
|
||||||
|
|
||||||
|
**/*.rb
|
||||||
|
**/*.html
|
||||||
|
**/*.json
|
||||||
|
**/*.md
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require("@discourse/lint-configs/prettier");
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
inherit_gem:
|
||||||
|
rubocop-discourse: stree-compat.yml
|
||||||
|
RSpec/NamedSubject:
|
||||||
|
Enabled: false
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
--print-width=100
|
||||||
|
--plugins=plugin/trailing_comma,plugin/disable_auto_ternary
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
module.exports = require("@discourse/lint-configs/template-lint");
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
source "https://rubygems.org"
|
||||||
|
|
||||||
|
group :development do
|
||||||
|
gem "rubocop-discourse"
|
||||||
|
gem "syntax_tree"
|
||||||
|
end
|
||||||
@@ -0,0 +1,88 @@
|
|||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
activesupport (7.1.3.4)
|
||||||
|
base64
|
||||||
|
bigdecimal
|
||||||
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
|
connection_pool (>= 2.2.5)
|
||||||
|
drb
|
||||||
|
i18n (>= 1.6, < 2)
|
||||||
|
minitest (>= 5.1)
|
||||||
|
mutex_m
|
||||||
|
tzinfo (~> 2.0)
|
||||||
|
ast (2.4.2)
|
||||||
|
base64 (0.2.0)
|
||||||
|
bigdecimal (3.1.8)
|
||||||
|
concurrent-ruby (1.3.3)
|
||||||
|
connection_pool (2.4.1)
|
||||||
|
drb (2.2.1)
|
||||||
|
i18n (1.14.5)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
|
json (2.7.2)
|
||||||
|
language_server-protocol (3.17.0.3)
|
||||||
|
minitest (5.24.1)
|
||||||
|
mutex_m (0.2.0)
|
||||||
|
parallel (1.25.1)
|
||||||
|
parser (3.3.3.0)
|
||||||
|
ast (~> 2.4.1)
|
||||||
|
racc
|
||||||
|
prettier_print (1.2.1)
|
||||||
|
racc (1.8.0)
|
||||||
|
rack (3.1.6)
|
||||||
|
rainbow (3.1.1)
|
||||||
|
regexp_parser (2.9.2)
|
||||||
|
rexml (3.3.1)
|
||||||
|
strscan
|
||||||
|
rubocop (1.64.1)
|
||||||
|
json (~> 2.3)
|
||||||
|
language_server-protocol (>= 3.17.0)
|
||||||
|
parallel (~> 1.10)
|
||||||
|
parser (>= 3.3.0.2)
|
||||||
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
|
regexp_parser (>= 1.8, < 3.0)
|
||||||
|
rexml (>= 3.2.5, < 4.0)
|
||||||
|
rubocop-ast (>= 1.31.1, < 2.0)
|
||||||
|
ruby-progressbar (~> 1.7)
|
||||||
|
unicode-display_width (>= 2.4.0, < 3.0)
|
||||||
|
rubocop-ast (1.31.3)
|
||||||
|
parser (>= 3.3.1.0)
|
||||||
|
rubocop-capybara (2.21.0)
|
||||||
|
rubocop (~> 1.41)
|
||||||
|
rubocop-discourse (3.8.1)
|
||||||
|
activesupport (>= 6.1)
|
||||||
|
rubocop (>= 1.59.0)
|
||||||
|
rubocop-capybara (>= 2.0.0)
|
||||||
|
rubocop-factory_bot (>= 2.0.0)
|
||||||
|
rubocop-rails (>= 2.25.0)
|
||||||
|
rubocop-rspec (>= 3.0.1)
|
||||||
|
rubocop-rspec_rails (>= 2.30.0)
|
||||||
|
rubocop-factory_bot (2.26.1)
|
||||||
|
rubocop (~> 1.61)
|
||||||
|
rubocop-rails (2.25.1)
|
||||||
|
activesupport (>= 4.2.0)
|
||||||
|
rack (>= 1.1)
|
||||||
|
rubocop (>= 1.33.0, < 2.0)
|
||||||
|
rubocop-ast (>= 1.31.1, < 2.0)
|
||||||
|
rubocop-rspec (3.0.2)
|
||||||
|
rubocop (~> 1.61)
|
||||||
|
rubocop-rspec_rails (2.30.0)
|
||||||
|
rubocop (~> 1.61)
|
||||||
|
rubocop-rspec (~> 3, >= 3.0.1)
|
||||||
|
ruby-progressbar (1.13.0)
|
||||||
|
strscan (3.1.0)
|
||||||
|
syntax_tree (6.2.0)
|
||||||
|
prettier_print (>= 1.2.0)
|
||||||
|
tzinfo (2.0.6)
|
||||||
|
concurrent-ruby (~> 1.0)
|
||||||
|
unicode-display_width (2.5.0)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
rubocop-discourse
|
||||||
|
syntax_tree
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
2.5.10
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2021 Civilized Discourse Construction Kit
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
@@ -1,3 +1,5 @@
|
|||||||
# Discourse AI is now shipped with Discourse core
|
# **Discourse AI** Plugin
|
||||||
|
|
||||||
https://github.com/discourse/discourse/tree/main/plugins/discourse-ai
|
**Plugin Summary**
|
||||||
|
|
||||||
|
For more information, please see: https://meta.discourse.org/t/discourse-ai/259214?u=falco
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default DiscourseRoute.extend({
|
||||||
|
async model() {
|
||||||
|
const record = this.store.createRecord("ai-llm");
|
||||||
|
return record;
|
||||||
|
},
|
||||||
|
|
||||||
|
setupController(controller, model) {
|
||||||
|
this._super(controller, model);
|
||||||
|
controller.set(
|
||||||
|
"allLlms",
|
||||||
|
this.modelFor("adminPlugins.show.discourse-ai-llms")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default DiscourseRoute.extend({
|
||||||
|
async model(params) {
|
||||||
|
const allLlms = this.modelFor("adminPlugins.show.discourse-ai-llms");
|
||||||
|
const id = parseInt(params.id, 10);
|
||||||
|
return allLlms.findBy("id", id);
|
||||||
|
},
|
||||||
|
|
||||||
|
setupController(controller, model) {
|
||||||
|
this._super(controller, model);
|
||||||
|
controller.set(
|
||||||
|
"allLlms",
|
||||||
|
this.modelFor("adminPlugins.show.discourse-ai-llms")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default class DiscourseAiAiLlmsRoute extends DiscourseRoute {
|
||||||
|
model() {
|
||||||
|
return this.store.findAll("ai-llm");
|
||||||
|
}
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
import { AUTO_GROUPS } from "discourse/lib/constants";
|
||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default DiscourseRoute.extend({
|
||||||
|
async model() {
|
||||||
|
const record = this.store.createRecord("ai-persona");
|
||||||
|
record.set("allowed_group_ids", [AUTO_GROUPS.trust_level_0.id]);
|
||||||
|
record.set("rag_uploads", []);
|
||||||
|
// these match the defaults on the table
|
||||||
|
record.set("rag_chunk_tokens", 374);
|
||||||
|
record.set("rag_chunk_overlap_tokens", 10);
|
||||||
|
record.set("rag_conversation_chunks", 10);
|
||||||
|
return record;
|
||||||
|
},
|
||||||
|
|
||||||
|
setupController(controller, model) {
|
||||||
|
this._super(controller, model);
|
||||||
|
controller.set(
|
||||||
|
"allPersonas",
|
||||||
|
this.modelFor("adminPlugins.show.discourse-ai-personas")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default DiscourseRoute.extend({
|
||||||
|
async model(params) {
|
||||||
|
const allPersonas = this.modelFor(
|
||||||
|
"adminPlugins.show.discourse-ai-personas"
|
||||||
|
);
|
||||||
|
const id = parseInt(params.id, 10);
|
||||||
|
return allPersonas.findBy("id", id);
|
||||||
|
},
|
||||||
|
|
||||||
|
setupController(controller, model) {
|
||||||
|
this._super(controller, model);
|
||||||
|
controller.set(
|
||||||
|
"allPersonas",
|
||||||
|
this.modelFor("adminPlugins.show.discourse-ai-personas")
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default class DiscourseAiAiPersonasRoute extends DiscourseRoute {
|
||||||
|
model() {
|
||||||
|
return this.store.findAll("ai-persona");
|
||||||
|
}
|
||||||
|
}
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default class DiscourseAiToolsNewRoute extends DiscourseRoute {
|
||||||
|
async model() {
|
||||||
|
return this.store.createRecord("ai-tool");
|
||||||
|
}
|
||||||
|
|
||||||
|
setupController(controller) {
|
||||||
|
super.setupController(...arguments);
|
||||||
|
const toolsModel = this.modelFor("adminPlugins.show.discourse-ai-tools");
|
||||||
|
|
||||||
|
controller.set("allTools", toolsModel);
|
||||||
|
controller.set("presets", toolsModel.resultSetMeta.presets);
|
||||||
|
}
|
||||||
|
}
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default class DiscourseAiToolsShowRoute extends DiscourseRoute {
|
||||||
|
async model(params) {
|
||||||
|
const allTools = this.modelFor("adminPlugins.show.discourse-ai-tools");
|
||||||
|
const id = parseInt(params.id, 10);
|
||||||
|
|
||||||
|
return allTools.find((tool) => tool.id === id);
|
||||||
|
}
|
||||||
|
|
||||||
|
setupController(controller) {
|
||||||
|
super.setupController(...arguments);
|
||||||
|
const toolsModel = this.modelFor("adminPlugins.show.discourse-ai-tools");
|
||||||
|
|
||||||
|
controller.set("allTools", toolsModel);
|
||||||
|
controller.set("presets", toolsModel.resultSetMeta.presets);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { service } from "@ember/service";
|
||||||
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
|
|
||||||
|
export default class DiscourseAiToolsRoute extends DiscourseRoute {
|
||||||
|
@service store;
|
||||||
|
|
||||||
|
model() {
|
||||||
|
return this.store.findAll("ai-tool");
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<AiLlmsListEditor @llms={{this.model}} />
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<AiLlmsListEditor @llms={{this.allLlms}} @currentLlm={{this.model}} />
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<AiLlmsListEditor @llms={{this.allLlms}} @currentLlm={{this.model}} />
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<AiPersonaListEditor @personas={{this.model}} />
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
<AiPersonaListEditor
|
||||||
|
@personas={{this.allPersonas}}
|
||||||
|
@currentPersona={{this.model}}
|
||||||
|
/>
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
<AiPersonaListEditor
|
||||||
|
@personas={{this.allPersonas}}
|
||||||
|
@currentPersona={{this.model}}
|
||||||
|
/>
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<AiToolListEditor @tools={{this.model}} />
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
<AiToolEditor
|
||||||
|
@tools={{this.allTools}}
|
||||||
|
@model={{this.model}}
|
||||||
|
@presets={{this.presets}}
|
||||||
|
/>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user