enhance embedding model support and update database schema for multi-model compatibility

This commit is contained in:
ImBenji
2026-04-18 16:43:13 +01:00
parent 5f2aa7f591
commit c6d5624656
4 changed files with 154 additions and 33 deletions
+11
View File
@@ -28,6 +28,13 @@ async function statusRoutes(fastify) {
{ total: 0, usable: 0 }
);
const embeddingModelRows = db.prepare(`
SELECT model, COUNT(*) AS article_count
FROM article_embedding_store
GROUP BY model
ORDER BY article_count DESC
`).all();
return {
total: totals.total,
usable: totals.usable,
@@ -35,6 +42,10 @@ async function statusRoutes(fastify) {
bySource: Object.fromEntries(
bySourceRows.map((row) => [row.source, { total: row.total, usable: row.usable }])
),
embeddingModels: embeddingModelRows.map((row) => ({
model: row.model,
articles: row.article_count,
})),
};
});
}