mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-07-28 15:02:37 +00:00
moving order of parameters
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
parent
7ae99f33e7
commit
22f2484edc
5 changed files with 16 additions and 16 deletions
9
docs/_static/llama-stack-spec.html
vendored
9
docs/_static/llama-stack-spec.html
vendored
|
@ -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"
|
||||
|
|
9
docs/_static/llama-stack-spec.yaml
vendored
9
docs/_static/llama-stack-spec.yaml
vendored
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
"""
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue