openai-go icon indicating copy to clipboard operation
openai-go copied to clipboard

A difference between the OpenAI Go SDK and Python SDK.

Open Meguminnnnnnnn opened this issue 9 months ago • 7 comments

When using Azure client, the Python SDK will check the path to determine whether to replace it, the code is as follows:

Image

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.

Image

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:

Image

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.

Image

Meguminnnnnnnn avatar Feb 26 '25 07:02 Meguminnnnnnnn