aurelio-labs / semantic-router

Superfast AI decision making and intelligent processing of multi-modal data.
https://www.aurelio.ai/semantic-router
MIT License
2.17k stars 224 forks source link

Connection Error using AzureOpenAIEncoder #429

Open singh-kun opened 2 months ago

singh-kun commented 2 months ago

I am using AzureOpenAIEncoder in a closed network which can only access the openai resources using httpx proxy. In the AzureOpenAIEncoder class, there is no way to provide that http_client.

Example how I am using Azure openai services: embedding= AzureOpenAIEmbeddings(model = model name, http_client=htpx.Client())

Note: I am defining all the other credentials as environmental variables like endpoint, api key, version and http proxy.

I have checked the AzureOpenAIEncoder class code and I saw it doesn't have any way to provide the above or similar parameter. There can be one fix, by including the openai client in the constructor of the class. This way I can give the azureopenai client as a parameter to this class.

Please guide me if I am missing something or there is any workaround.

Do let me know if you need more information. I really appreciate the help 🙏

jamescalam commented 2 months ago

Hi @singh-kun we currently don't have a workaround for this, beyond possibly setting this attribute after initializing the encoder instance, we're happy if you want to contribute this as a feature though