This commit is contained in:
ValueOn AG 2026-04-14 08:40:43 +02:00
parent d2611ff498
commit 591e890527

View file

@ -530,6 +530,21 @@ class KnowledgeObjects:
total_chunks = len(chunks)
embedding_pct = round(100.0 * chunks_with_embedding / total_chunks, 1) if total_chunks else 0.0
sorted_files = sorted(
files,
key=lambda r: float(r.get("extractedAt") or 0),
reverse=True,
)
recently_indexed = []
for row in sorted_files[:10]:
recently_indexed.append({
"fileName": row.get("fileName", ""),
"mimeType": row.get("mimeType", ""),
"status": row.get("status", "unknown"),
"extractedAt": row.get("extractedAt"),
"totalSize": row.get("totalSize", 0),
})
return {
"scope": {
"featureInstanceId": featureInstanceId,
@ -548,6 +563,7 @@ class KnowledgeObjects:
"documentsByMimeCategory": dict(sorted(mime_counts.items(), key=lambda x: -x[1])),
"chunksByContentType": dict(sorted(content_type_counts.items())),
"timelineIndexedDocuments": timeline,
"recentlyIndexedDocuments": recently_indexed,
"generatedAtUtc": datetime.now(timezone.utc).isoformat(),
}