From 0cc625560d1d923cd43a8140fdaec6ab5b68ebc4 Mon Sep 17 00:00:00 2001 From: Francisco Javier Arceo Date: Wed, 25 Jun 2025 09:57:02 -0400 Subject: [PATCH] updated qdrant Signed-off-by: Francisco Javier Arceo --- docs/_static/llama-stack-spec.html | 3 --- docs/_static/llama-stack-spec.yaml | 2 -- llama_stack/apis/vector_io/vector_io.py | 2 +- llama_stack/providers/remote/vector_io/qdrant/qdrant.py | 8 ++------ 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index e4bf794e1..a4c94dc0b 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -11296,9 +11296,6 @@ } }, "additionalProperties": false, - "required": [ - "chunk_id" - ], "title": "ChunkMetadata", "description": "`ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional information about the chunk that will not be used in the context during inference, but is required for backend functionality. The `ChunkMetadata` is set during chunk creation in `MemoryToolRuntimeImpl().insert()`and is not expected to change after. Use `Chunk.metadata` for metadata that will be used in the context during inference." }, diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index 822462c09..02cff4f5b 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -7960,8 +7960,6 @@ components: description: >- The number of tokens in the metadata of the chunk. additionalProperties: false - required: - - chunk_id title: ChunkMetadata description: >- `ChunkMetadata` is backend metadata for a `Chunk` that is used to store additional diff --git a/llama_stack/apis/vector_io/vector_io.py b/llama_stack/apis/vector_io/vector_io.py index 6762c0d3f..951b2a15d 100644 --- a/llama_stack/apis/vector_io/vector_io.py +++ b/llama_stack/apis/vector_io/vector_io.py @@ -41,7 +41,7 @@ class ChunkMetadata(BaseModel): :param metadata_token_count: The number of tokens in the metadata of the chunk. """ - chunk_id: str = None + chunk_id: str | None = None document_id: str | None = None source: str | None = None created_timestamp: int | None = None diff --git a/llama_stack/providers/remote/vector_io/qdrant/qdrant.py b/llama_stack/providers/remote/vector_io/qdrant/qdrant.py index fc377509d..7fd451bf6 100644 --- a/llama_stack/providers/remote/vector_io/qdrant/qdrant.py +++ b/llama_stack/providers/remote/vector_io/qdrant/qdrant.py @@ -71,12 +71,8 @@ class QdrantIndex(EmbeddingIndex): ) points = [] - for i, (chunk, embedding) in enumerate(zip(chunks, embeddings, strict=False)): - chunk_id = ( - f"{chunk.metadata.get('document_id')}:chunk-{i}" - if chunk.metadata - else f"{chunk.chunk_metadata.document_id}:chunk-{i}" - ) + for _i, (chunk, embedding) in enumerate(zip(chunks, embeddings, strict=False)): + chunk_id = chunk.chunk_id points.append( PointStruct( id=convert_id(chunk_id),