Skip to content

Conversation

ashwinb
Copy link
Contributor

@ashwinb ashwinb commented Oct 11, 2025

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_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()

…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()
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 11, 2025
@ashwinb ashwinb changed the title feat(api)!: support passing extra_body to embeddings and vector_stores APIs feat(api): support passing extra_body to embeddings and vector_stores APIs Oct 12, 2025
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.
@ashwinb ashwinb changed the title feat(api): support passing extra_body to embeddings and vector_stores APIs feat(api): support extra_body to embeddings and vector_stores APIs Oct 12, 2025
…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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still want this default?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess so for tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franciscojavierarceo yeah I should kill that and see what breaks

@ashwinb ashwinb changed the title feat(api): support extra_body to embeddings and vector_stores APIs feat(api)!: support extra_body to embeddings and vector_stores APIs Oct 13, 2025
Copy link
Collaborator

@franciscojavierarceo franciscojavierarceo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ashwinb
Copy link
Contributor Author

ashwinb commented Oct 13, 2025

Green finally. Corresponding llama-stack-client changes: llamastack/llama-stack-client-python#280

@ashwinb ashwinb merged commit ecc8a55 into main Oct 13, 2025
22 checks passed
@ashwinb ashwinb deleted the embeddings_extra_body branch October 13, 2025 02:01
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()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants