mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-06-30 20:39:43 +02:00
refactor(filesystem): unify pifs metadata state
This commit is contained in:
parent
fc0be1aeee
commit
7c021a7dd0
8 changed files with 479 additions and 324 deletions
|
|
@ -68,7 +68,7 @@ class SummaryProjectionIndexer:
|
|||
)
|
||||
|
||||
def upsert_summary(self, record: dict[str, Any]) -> dict[str, Any]:
|
||||
summary = str((record.get("derived_metadata") or {}).get("summary") or "").strip()
|
||||
summary = str((record.get("metadata") or {}).get("summary") or "").strip()
|
||||
if not summary:
|
||||
return {"status": "skipped", "reason": "missing_summary"}
|
||||
vector = self.embedding_cache.embed_texts(
|
||||
|
|
@ -79,7 +79,6 @@ class SummaryProjectionIndexer:
|
|||
batch_size=1,
|
||||
)[0]
|
||||
metadata = dict(record.get("metadata") or {})
|
||||
metadata.update(record.get("derived_metadata") or {})
|
||||
count = self.index.upsert_many(
|
||||
[
|
||||
SemanticIndexRecord(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue