Spaces:
Sleeping
Sleeping
Update app/policy_vector_db.py
Browse files- app/policy_vector_db.py +1 -1
app/policy_vector_db.py
CHANGED
|
@@ -43,7 +43,7 @@ class PolicyVectorDB:
|
|
| 43 |
return
|
| 44 |
|
| 45 |
# Fetch existing IDs to avoid re-adding the same chunks on subsequent runs
|
| 46 |
-
existing_ids = set(collection.get(
|
| 47 |
new_chunks = [chunk for chunk in chunks if chunk.get('id') not in existing_ids]
|
| 48 |
|
| 49 |
if not new_chunks:
|
|
|
|
| 43 |
return
|
| 44 |
|
| 45 |
# Fetch existing IDs to avoid re-adding the same chunks on subsequent runs
|
| 46 |
+
existing_ids = set(collection.get()['ids']) # This gets all IDs by default
|
| 47 |
new_chunks = [chunk for chunk in chunks if chunk.get('id') not in existing_ids]
|
| 48 |
|
| 49 |
if not new_chunks:
|