microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
349 stars 143 forks source link

[Bug]: Exception thrown for HTTP embeddings call with AOAI #1688

Closed KrishnP1202 closed 1 month ago

KrishnP1202 commented 1 month ago

Language

Python

Version

latest

Description

We are using an internal loadbalancer, which is http for embedding call, and we have been using with azureopenai library for this already. But here we are getting an exception that the endpoint must be a valid HTTPS url. Can you allow http endpoints too.

Reproduction Steps

1.Using http azure endpoint for embedding calls
lilyydu commented 1 month ago

Hi @KrishnP1202, could you provide more details on your logic and where the exception is being thrown?

KrishnP1202 commented 1 month ago

Hey @lilyydu, I was trying to use the AzureOpenAIEmbeddings using azure_endpoint which is http. I got this error in the init function of the AzureOpenAIEmbeddings class inside the library. if not endpoint.lower().startswith("https://"): raise ValueError(f""" Client created with an invalid endpoint of \"{endpoint}\". The endpoint must be a valid HTTPS url. """)

lilyydu commented 1 month ago

Got it @KrishnP1202 . Just discussed and confirmed with the team, I'll make a PR to remove this check shortly

KrishnP1202 commented 1 month ago

That's great @lilyydu, thank you