fix
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import json
|
||||
import math
|
||||
import uuid
|
||||
from collections import defaultdict
|
||||
|
||||
from qdrant_client import QdrantClient, models
|
||||
@@ -46,7 +47,7 @@ class LightRAGAdapter:
|
||||
collection_name=self.settings.qdrant_collection,
|
||||
points=[
|
||||
models.PointStruct(
|
||||
id=job.job_id,
|
||||
id=self._point_id(job.job_id),
|
||||
vector=self._vectorize(payload["document"]),
|
||||
payload=payload,
|
||||
)
|
||||
@@ -69,7 +70,7 @@ class LightRAGAdapter:
|
||||
collection_name=self.settings.qdrant_collection,
|
||||
points=[
|
||||
models.PointStruct(
|
||||
id=worker.worker_id,
|
||||
id=self._point_id(worker.worker_id),
|
||||
vector=self._vectorize(payload["document"]),
|
||||
payload=payload,
|
||||
)
|
||||
@@ -141,3 +142,7 @@ class LightRAGAdapter:
|
||||
if chunk:
|
||||
tokens.append(chunk)
|
||||
return tokens
|
||||
|
||||
def _point_id(self, entity_id: str) -> str:
|
||||
# Qdrant v1.14 accepts point IDs as UUID or unsigned int.
|
||||
return str(uuid.uuid5(uuid.NAMESPACE_URL, entity_id))
|
||||
|
||||
Reference in New Issue
Block a user