chore: Migrating VectorDB to use OpenAI compatible identifier

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
This commit is contained in:
Francisco Javier Arceo 2025-07-03 22:02:06 -04:00
parent b094960199
commit ddb29b306c
9 changed files with 44 additions and 22 deletions

View file

@ -35,9 +35,10 @@ class VectorDBsRoutingTable(CommonRoutingTableImpl, VectorDBs):
embedding_model: str,
embedding_dimension: int | None = 384,
provider_id: str | None = None,
provider_vector_db_id: str | None = None,
provider_vector_db_id: str = "",
provider_vector_db_name: str | None = None,
) -> VectorDB:
if provider_vector_db_id is None:
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:
@ -62,6 +63,7 @@ class VectorDBsRoutingTable(CommonRoutingTableImpl, VectorDBs):
"provider_resource_id": provider_vector_db_id,
"embedding_model": embedding_model,
"embedding_dimension": model.metadata["embedding_dimension"],
"vector_db_name": provider_vector_db_name,
}
vector_db = TypeAdapter(VectorDBWithOwner).validate_python(vector_db_data)
await self.register_object(vector_db)