mirror of
https://github.com/meta-llama/llama-stack.git
synced 2026-01-02 06:10:01 +00:00
rebase issues
Signed-off-by: Daniele Martinoli <dmartino@redhat.com>
This commit is contained in:
parent
427f69f4f0
commit
dfffeb6dcf
5 changed files with 16 additions and 15 deletions
|
|
@ -103,13 +103,17 @@ class QdrantVectorIOAdapter(VectorIO, VectorDBsProtocolPrivate):
|
|||
def __init__(
|
||||
self, config: Union[RemoteQdrantVectorIOConfig, InlineQdrantVectorIOConfig], inference_api: Api.inference
|
||||
) -> None:
|
||||
# TODO: this is required otherwise the precommit hook fails with
|
||||
# _init__.py:17: error: Cannot instantiate abstract class "QdrantVectorIOAdapter" with abstract attribute "vector_db_store" [abstract]
|
||||
# Will investigate further and remove it once fixed
|
||||
self.vector_db_store = None
|
||||
self.config = config
|
||||
self.client = AsyncQdrantClient(**self.config.model_dump(exclude_none=True))
|
||||
self.client: AsyncQdrantClient = None
|
||||
self.cache = {}
|
||||
self.inference_api = inference_api
|
||||
|
||||
async def initialize(self) -> None:
|
||||
pass
|
||||
self.client = AsyncQdrantClient(**self.config.model_dump(exclude_none=True))
|
||||
|
||||
async def shutdown(self) -> None:
|
||||
self.client.close()
|
||||
|
|
@ -126,6 +130,11 @@ class QdrantVectorIOAdapter(VectorIO, VectorDBsProtocolPrivate):
|
|||
|
||||
self.cache[vector_db.identifier] = index
|
||||
|
||||
async def unregister_vector_db(self, vector_db_id: str) -> None:
|
||||
if vector_db_id in self.cache:
|
||||
await self.cache[vector_db_id].index.delete()
|
||||
del self.cache[vector_db_id]
|
||||
|
||||
async def _get_and_cache_vector_db_index(self, vector_db_id: str) -> Optional[VectorDBWithIndex]:
|
||||
if vector_db_id in self.cache:
|
||||
return self.cache[vector_db_id]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue