http_client and http_async_client bugfix #1454
Merged
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.
Description
This would allow users to use pass proxy servers via config. It would allow them to use Embedchain behind a company's proxy setting.
Current implementation lacks creating of
httpx
or anyHttpClient
interface. It expects user a client in config, but there is no documentation on how to use it. I also believe its not possible to pass it thishttp_client
value from the config.This PR allows http proxies to be passed down from config instead, including async proxies (all
examples in unit tests). It creates a
httpx.Client
orhttpx.AsyncClient
as mentioned in the Langchain docs on behalf of the user.Fixes #1452
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I tested this on my AzureOpenAI instance, but could not test it for Openai.
I have unit tests for both, other pr adds azure.
Checklist:
Maintainer Checklist