Skip to content
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

Add https:// prefix to azure_endpoint when missing #2166

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

Conversation

daravi
Copy link

@daravi daravi commented Mar 6, 2025

Add https:// prefix to azure_endpoint when missing to avoid faulty URL construction where azure_endpoint is repeated twice

  • I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

Please either apply this change to add https:// prefix to azure_endpoint or throw exception when it is missing. Otherwise the https client will create a weird URL like

<azure-ai-service-name>.cognitiveservices.azure.com/openai/<azure-ai-service-name>.cognitiveservices.azure.com/openai/deployments/<deployment-name>/chat/completions

Since host is not correctly parsed and set on the base URL.

Additional context & links

…L construction where azure_endpoint is repeated twice
@daravi daravi requested a review from a team as a code owner March 6, 2025 11:26
@kristapratico
Copy link
Contributor

@daravi can you share the scenario where an endpoint wouldn't already have https://? I think all places I've seen where you can copy the endpoint value e.g. from the Azure portal, CLI, etc. will always include it.

@daravi
Copy link
Author

daravi commented Mar 18, 2025

@kristapratico I mistakenly did not include https when running and was surprised that such URL was constructed:

https://<azure-ai-service-name>.cognitiveservices.azure.com/openai/<azure-ai-service-name>.cognitiveservices.azure.com/openai/deployments/<deployment-name>/chat/completions

If we don't want to add it we can also throw an exception if endpoint format is not correctly having https.

Just a suggestion. Since it happened to me I figured it may happen to others as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants