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

openai.beta.threads.create has the wrong type for TS

Open robin-pham opened this issue 1 year ago • 3 comments

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

  • [X] This is an issue with the Node library

Describe the bug

The auto-generated type for threads.create is wrong as it's possible to have a .create() with no args based off the docs

Screenshot_2023-11-06_21-09-10

To Reproduce

In a typescript repo, invoke openai.beta.threads.runs.create() with no args and observe a type error

Code snippets

No response

OS

N/A

Node version

Any

Library version

4.16.1

robin-pham avatar Nov 07 '23 05:11 robin-pham

Thanks for reporting, we hope to fix this soon.

rattrayalex avatar Nov 07 '23 07:11 rattrayalex

Is there a quick workaround for this issue?

121yaseen avatar Nov 16 '23 16:11 121yaseen

The workaround would be to pass an empty object, perhaps with an as any annotation

rattrayalex avatar Nov 16 '23 17:11 rattrayalex