mirror of
https://ghfast.top/https://github.com/discourse/discourse-ai.git
synced 2026-05-28 01:24:29 +08:00
* Use AR model for embeddings features * endpoints * Embeddings CRUD UI * Add presets. Hide a couple more settings * system specs * Seed embedding definition from old settings * Generate search bit index on the fly. cleanup orphaned data * support for seeded models * Fix run test for new embedding * fix selected model not set correctly
21 lines
648 B
JavaScript
21 lines
648 B
JavaScript
import DiscourseRoute from "discourse/routes/discourse";
|
|
|
|
export default class AdminPluginsShowDiscourseAiEmbeddingsEdit extends DiscourseRoute {
|
|
async model(params) {
|
|
const allEmbeddings = this.modelFor(
|
|
"adminPlugins.show.discourse-ai-embeddings"
|
|
);
|
|
const id = parseInt(params.id, 10);
|
|
const record = allEmbeddings.findBy("id", id);
|
|
record.provider_params = record.provider_params || {};
|
|
return record;
|
|
}
|
|
|
|
setupController(controller, model) {
|
|
super.setupController(controller, model);
|
|
controller.set(
|
|
"allEmbeddings",
|
|
this.modelFor("adminPlugins.show.discourse-ai-embeddings")
|
|
);
|
|
}
|
|
}
|