2024-05-13 11:46:42 -04:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
|
2024-11-29 10:41:09 -05:00
|
|
|
export default class AdminPluginsShowDiscourseAiLlmsNew extends DiscourseRoute {
|
|
|
|
queryParams = {
|
2024-09-30 03:15:11 -04:00
|
|
|
llmTemplate: { refreshModel: true },
|
2024-11-29 10:41:09 -05:00
|
|
|
};
|
2024-09-30 03:15:11 -04:00
|
|
|
|
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;
|
2024-11-29 10:41:09 -05:00
|
|
|
}
|
2024-05-13 11:46:42 -04:00
|
|
|
|
|
|
|
setupController(controller, model) {
|
2024-11-29 10:41:09 -05:00
|
|
|
super.setupController(controller, model);
|
2024-05-13 11:46:42 -04:00
|
|
|
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-11-29 10:41:09 -05:00
|
|
|
}
|
|
|
|
}
|