diff --git a/docs/_static/llama-stack-spec.html b/docs/_static/llama-stack-spec.html index d53904c74..2ec7c8369 100644 --- a/docs/_static/llama-stack-spec.html +++ b/docs/_static/llama-stack-spec.html @@ -15610,6 +15610,10 @@ "type": "string", "description": "The identifier of the vector database to register." }, + "provider_vector_db_id": { + "type": "string", + "description": "The identifier of the vector database in the provider." + }, "embedding_model": { "type": "string", "description": "The embedding model to use." @@ -15622,10 +15626,6 @@ "type": "string", "description": "The identifier of the provider." }, - "provider_vector_db_id": { - "type": "string", - "description": "The identifier of the vector database in the provider." - }, "vector_db_name": { "type": "string", "description": "The name of the vector database." @@ -15634,6 +15634,7 @@ "additionalProperties": false, "required": [ "vector_db_id", + "provider_vector_db_id", "embedding_model" ], "title": "RegisterVectorDbRequest" diff --git a/docs/_static/llama-stack-spec.yaml b/docs/_static/llama-stack-spec.yaml index 2081cf154..76340f061 100644 --- a/docs/_static/llama-stack-spec.yaml +++ b/docs/_static/llama-stack-spec.yaml @@ -10922,6 +10922,10 @@ components: type: string description: >- The identifier of the vector database to register. + provider_vector_db_id: + type: string + description: >- + The identifier of the vector database in the provider. embedding_model: type: string description: The embedding model to use. @@ -10931,16 +10935,13 @@ components: provider_id: type: string description: The identifier of the provider. - provider_vector_db_id: - type: string - description: >- - The identifier of the vector database in the provider. vector_db_name: type: string description: The name of the vector database. additionalProperties: false required: - vector_db_id + - provider_vector_db_id - embedding_model title: RegisterVectorDbRequest ResumeAgentTurnRequest: diff --git a/llama_stack/apis/vector_dbs/vector_dbs.py b/llama_stack/apis/vector_dbs/vector_dbs.py index ee0b6217e..e4f41ad1a 100644 --- a/llama_stack/apis/vector_dbs/vector_dbs.py +++ b/llama_stack/apis/vector_dbs/vector_dbs.py @@ -68,19 +68,19 @@ class VectorDBs(Protocol): async def register_vector_db( self, vector_db_id: str, + provider_vector_db_id: str, embedding_model: str, embedding_dimension: int | None = 384, provider_id: str | None = None, - provider_vector_db_id: str | None = None, vector_db_name: str | None = None, ) -> VectorDB: """Register a vector database. :param vector_db_id: The identifier of the vector database to register. + :param provider_vector_db_id: The identifier of the vector database in the provider. :param embedding_model: The embedding model to use. :param embedding_dimension: The dimension of the embedding model. :param provider_id: The identifier of the provider. - :param provider_vector_db_id: The identifier of the vector database in the provider. :param vector_db_name: The name of the vector database. :returns: A VectorDB. """ diff --git a/llama_stack/distribution/routers/vector_io.py b/llama_stack/distribution/routers/vector_io.py index 8ddbeef77..1f8cf56d3 100644 --- a/llama_stack/distribution/routers/vector_io.py +++ b/llama_stack/distribution/routers/vector_io.py @@ -79,19 +79,19 @@ class VectorIORouter(VectorIO): async def register_vector_db( self, vector_db_id: str, + provider_vector_db_id: str, embedding_model: str, embedding_dimension: int | None = 384, provider_id: str | None = None, - provider_vector_db_id: str | None = None, vector_db_name: str | None = None, ) -> None: logger.debug(f"VectorIORouter.register_vector_db: {vector_db_id}, {embedding_model}") await self.routing_table.register_vector_db( vector_db_id, + provider_vector_db_id, embedding_model, embedding_dimension, provider_id, - provider_vector_db_id, vector_db_name, ) @@ -139,11 +139,11 @@ class VectorIORouter(VectorIO): vector_db_id = f"vs_{uuid.uuid4()}" registered_vector_db = await self.routing_table.register_vector_db( + vector_db_id, vector_db_id, embedding_model, embedding_dimension, provider_id, - vector_db_id, name, ) return await self.routing_table.get_provider_impl(registered_vector_db.identifier).openai_create_vector_store( diff --git a/llama_stack/distribution/routing_tables/vector_dbs.py b/llama_stack/distribution/routing_tables/vector_dbs.py index a6c97b09c..87e67bfeb 100644 --- a/llama_stack/distribution/routing_tables/vector_dbs.py +++ b/llama_stack/distribution/routing_tables/vector_dbs.py @@ -32,14 +32,12 @@ class VectorDBsRoutingTable(CommonRoutingTableImpl, VectorDBs): async def register_vector_db( self, vector_db_id: str, + provider_vector_db_id: str, embedding_model: str, embedding_dimension: int | None = 384, provider_id: str | None = None, - provider_vector_db_id: str = "", vector_db_name: str | None = None, ) -> VectorDB: - if provider_vector_db_id == "": - provider_vector_db_id = vector_db_id if provider_id is None: if len(self.impls_by_provider_id) > 0: provider_id = list(self.impls_by_provider_id.keys())[0]