ragas
ragas copied to clipboard
Add base_url parameter to embedding_factory for custom endpoint support
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.