2024-05-13 11:46:42 -04:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
|
|
|
|
export default DiscourseRoute.extend({
|
2024-09-30 03:15:11 -04:00
|
|
|
queryParams: {
|
|
|
|
llmTemplate: { refreshModel: true },
|
|
|
|
},
|
|
|
|
|
2024-05-13 11:46:42 -04:00
|
|
|
async model() {
|
|
|
|
const record = this.store.createRecord("ai-llm");
|
2024-08-07 15:08:56 -04:00
|
|
|
record.provider_params = {};
|
2024-05-13 11:46:42 -04:00
|
|
|
return record;
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
this._super(controller, model);
|
|
|
|
controller.set(
|
|
|
|
"allLlms",
|
|
|
|
this.modelFor("adminPlugins.show.discourse-ai-llms")
|
|
|
|
);
|
2024-09-30 03:15:11 -04:00
|
|
|
controller.set(
|
|
|
|
"llmTemplate",
|
|
|
|
this.paramsFor(this.routeName).llmTemplate || null
|
|
|
|
);
|
2024-05-13 11:46:42 -04:00
|
|
|
},
|
|
|
|
});
|