mirror of
https://ghfast.top/https://github.com/discourse/discourse-ai.git
synced 2026-07-16 11:36:23 +08:00
This PR introduces the concept of "LlmModel" as a new way to quickly add new LLM models without making any code changes. We are releasing this first version and will add incremental improvements, so expect changes. The AI Bot can't fully take advantage of this feature as users are hard-coded. We'll fix this in a separate PR.s
17 lines
465 B
JavaScript
17 lines
465 B
JavaScript
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")
|
|
);
|
|
},
|
|
});
|