feat(api)!: support extra_body to embeddings and vector_stores APIs#3794
Merged
feat(api)!: support extra_body to embeddings and vector_stores APIs#3794
Conversation
…s APIs Applies the same pattern from #3777 to embeddings and vector_stores.create() endpoints. Breaking change: Method signatures now accept a single params object with Pydantic extra="allow" instead of individual parameters. Provider-specific params can be passed via extra_body and accessed through params.model_extra. Updated APIs: openai_embeddings(), openai_create_vector_store(), openai_create_vector_store_file_batch()
VectorIORouter was still using old individual parameter signature instead of the new params object. Updated both openai_create_vector_store and openai_create_vector_store_file_batch methods to match the API protocol.
…thods VectorDBsRoutingTable was removed in a165b8b, so VectorIORouter needs to get the provider directly using routing_table.get_provider_impl() before calling provider methods, consistent with how insert_chunks() already works.
| # Extract llama-stack-specific parameters from extra_body | ||
| extra = params.model_extra or {} | ||
| embedding_model = extra.get("embedding_model") | ||
| embedding_dimension = extra.get("embedding_dimension", 384) |
Collaborator
There was a problem hiding this comment.
do we still want this default?
Collaborator
There was a problem hiding this comment.
i guess so for tests
Contributor
Author
There was a problem hiding this comment.
@franciscojavierarceo yeah I should kill that and see what breaks
Contributor
Author
|
Green finally. Corresponding llama-stack-client changes: llamastack/llama-stack-client-python#280 |
jwm4
pushed a commit
to jwm4/llama-stack
that referenced
this pull request
Oct 13, 2025
…lamastack#3794) Applies the same pattern from llamastack#3777 to embeddings and vector_stores.create() endpoints. This should _not_ be a breaking change since (a) our tests were already using the `extra_body` parameter when passing in to the backend (b) but the backend probably wasn't extracting the parameters correctly. This PR will fix that. Updated APIs: `openai_embeddings(), openai_create_vector_store(), openai_create_vector_store_file_batch()`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Applies the same pattern from #3777 to embeddings and vector_stores.create() endpoints.
This should not be a breaking change since (a) our tests were already using the
extra_bodyparameter when passing in to the backend (b) but the backend probably wasn't extracting the parameters correctly. This PR will fix that.Updated APIs:
openai_embeddings(), openai_create_vector_store(), openai_create_vector_store_file_batch()