openai-go
openai-go copied to clipboard
A difference between the OpenAI Go SDK and Python SDK.
When using Azure client, the Python SDK will check the path to determine whether to replace it, the code is as follows:
And the URL in FinalRequestOptions is only the path of the API, such as /chat/completions, and does not include the path that may exist in the baseURL.
But in the Go SDK, this value becomes the path of the entire request, so if the BaseURL contains a path, this path will also be included:
However, in the subsequent processing, only the path of the API is still used for matching. This causes the matching to fail if the BaseURL contains a path (not just the domain), resulting in a failed request.