Skip to content

Add base_url parameter to embedding_factory for custom endpoint support #2019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

KoLogicDev
Copy link

Summary

This PR adds a base_url parameter to the embedding_factory function, allowing users to specify a custom API endpoint for the embedding model. This is particularly useful when working with OpenAI-compatible APIs hosted on private or self-hosted infrastructure.

Changes

  • Added base_url: Optional[str] = None to embedding_factory
  • Passed base_url to OpenAIEmbeddings initialization

Motivation

Enables greater flexibility when using embedding_factory, such as routing requests to non-default or local endpoints.

Notes

No breaking changes introduced. Default behavior remains unchanged when base_url is not provided.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:XS This PR changes 0-9 lines, ignoring generated files.
1 participant