Skip to content

Type errors after updating to 4.85.0 #1330

Closed
@michaelgrewal

Description

@michaelgrewal

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

I updated to 4.85.0 and noticed that the imports changed to "openai/resources/chat/completions/completions", so I went ahead and changed my imports in my project, but then new errors started surfacing with Types.

1st issue:
openai.beta.chat.completions.runTools() previously returned a ChatCompletionStreamingRunner when my body is ChatCompletionStreamingToolRunnerParams. Now the inferred return Type returned is ChatCompletionRunner and my build pipeline is failing.

2nd issue:
AbstractChatCompletionRunner this._createChatCompletion() previously returned a ChatCompletion, but now the inferred return type is a ParsedChatCompletion and my build pipeline is failing.

Reverting back to 4.84.0 works, so something broke with the latest 4.85.0 released today.

Thank you

To Reproduce

  1. Install [email protected]
  2. The first issue mentioned
let runner: ChatCompletionStreamingRunner;
runner =  openAI.beta.chat.completions.runTools(
    body,
    { signal: signal }
);
  1. The second issue mentioned, it's inside the AbstractChatCompletionRunner _runTools(). I have my own custom class extending from AbstractChatCompletionRunner but if I revert my changes and just copy and paste the code from AbstractChatCompletionRunner.ts then I see the error.

These issues do not happen with 4.84.0

Code snippets

OS

Windows

Node version

Node v20.12.2

Library version

openai 4.85.0

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