Skip to content

openAI AzureOpenAI baseURL issue. #1669

@bibhuti9

Description

@bibhuti9

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

Thanks OpenAI team for providing this great Node package. While debugging, I noticed a potential issue in the AzureOpenAI class.

In the documentation, the example endpoint URL is shown as https://example-resource.azure.openai.com/. However, when the baseURL is constructed, it results in double slashes:

baseURL = `${endpoint}/openai`;
// https://example-resource.azure.openai.com//openai

I’m not sure if I’m misunderstanding something, or if this is indeed an issue in the AzureOpenAI class. Could you please take a look?

To Reproduce

this.azureOpenAI = new AzureOpenAI({
apiKey: this.azureOpenAIKey,
endpoint: this.azureOpenAIEndpoint,
apiVersion: this.azureOpenAIVersion,
});

Code snippets

OS

macOS

Node version

Node 21

Library version

"openai": "^4.87.3"

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions