You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confirm this is an issue with the Python library and not an underlying OpenAI API
This is an issue with the Python library
Describe the bug
In src/openai/lib/azure.py, there are four cases where the endpoint URL is simply concatenated like:
f"{azure_endpoint}/openai/deployments/{azure_deployment}"
or f"{azure_endpoint}/openai"
If azure_endpoint has a trailing forward slash (which many comments in the code suggest is allowed, as well as an example in the repository), it will have // in the URL, which is wrong.
To make it agnostic, it should be:
f"{azure_endpoint.rstrip("/")}/openai/deployments/{azure_deployment}"
and f"{azure_endpoint.rstrip("/")}/openai"
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
In src/openai/lib/azure.py, there are four cases where the endpoint URL is simply concatenated like:
f"{azure_endpoint}/openai/deployments/{azure_deployment}"
or
f"{azure_endpoint}/openai"
If
azure_endpoint
has a trailing forward slash (which many comments in the code suggest is allowed, as well as an example in the repository), it will have//
in the URL, which is wrong.To make it agnostic, it should be:
f"{azure_endpoint.rstrip("/")}/openai/deployments/{azure_deployment}"
and
f"{azure_endpoint.rstrip("/")}/openai"
This would be sufficient to fix it: #1893 673a496
To Reproduce
Code snippets
No response
OS
Windows 10
Python version
Python 3.12.4
Library version
openai v1.6.1
The text was updated successfully, but these errors were encountered: