mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-07 02:58:21 +00:00
fix: Update Qdrant support post-refactor
Signed-off-by: Bill Murdock <bmurdock@redhat.com>
This commit is contained in:
parent
b981b49bfa
commit
eeae5f6cbc
2 changed files with 6 additions and 3 deletions
|
@ -12,8 +12,8 @@ from .config import QdrantConfig
|
|||
|
||||
|
||||
async def get_adapter_impl(config: QdrantConfig, deps: Dict[Api, ProviderSpec]):
|
||||
from .qdrant import QdrantVectorMemoryAdapter
|
||||
from .qdrant import QdrantVectorDBAdapter
|
||||
|
||||
impl = QdrantVectorMemoryAdapter(config, deps[Api.inference])
|
||||
impl = QdrantVectorDBAdapter(config, deps[Api.inference])
|
||||
await impl.initialize()
|
||||
return impl
|
||||
|
|
|
@ -55,7 +55,7 @@ class QdrantIndex(EmbeddingIndex):
|
|||
|
||||
points = []
|
||||
for i, (chunk, embedding) in enumerate(zip(chunks, embeddings)):
|
||||
chunk_id = f"{chunk.document_id}:chunk-{i}"
|
||||
chunk_id = f"{chunk.metadata['document_id']}:chunk-{i}"
|
||||
points.append(
|
||||
PointStruct(
|
||||
id=convert_id(chunk_id),
|
||||
|
@ -93,6 +93,9 @@ class QdrantIndex(EmbeddingIndex):
|
|||
|
||||
return QueryChunksResponse(chunks=chunks, scores=scores)
|
||||
|
||||
async def delete(self):
|
||||
await self.client.delete_collection(collection_name=self.collection_name)
|
||||
|
||||
|
||||
class QdrantVectorDBAdapter(VectorIO, VectorDBsProtocolPrivate):
|
||||
def __init__(self, config: QdrantConfig, inference_api: Api.inference) -> None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue