mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-13 04:22:35 +00:00
[WIP] Configurable distance_metric:
- Configurable distance_metric enabled for PGVector. - Added plumbing to support configuring more distance metrics for each vector provider.
This commit is contained in:
parent
658fb2c777
commit
9658581cf7
11 changed files with 187 additions and 18 deletions
|
|
@ -392,6 +392,9 @@ class OpenAIVectorStoreMixin(ABC):
|
|||
if provider_id is None:
|
||||
raise ValueError("Provider ID is required but was not provided")
|
||||
|
||||
# Extract distance_metric from extra_body if provided
|
||||
distance_metric = extra_body.get("distance_metric")
|
||||
|
||||
# call to the provider to create any index, etc.
|
||||
vector_store = VectorStore(
|
||||
identifier=vector_store_id,
|
||||
|
|
@ -400,6 +403,7 @@ class OpenAIVectorStoreMixin(ABC):
|
|||
provider_id=provider_id,
|
||||
provider_resource_id=vector_store_id,
|
||||
vector_store_name=params.name,
|
||||
distance_metric=distance_metric,
|
||||
)
|
||||
await self.register_vector_store(vector_store)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue