mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-02-17 17:04:48 +00: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
18 lines
465 B
JavaScript
18 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")
|
|
);
|
|
},
|
|
});
|