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

RunnerOptions is not exposed for runTools and runFunctions

Open tday opened this issue 1 year ago • 2 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 maxChatCompletions option is very helpful in managing costs. However, it is not exposed through the interface due to a typing bug.

I think the fix is to simply change the Core.RequestOptions type to RunnerOptions which only contains maxCompletions at the moment.

To Reproduce

Try passing maxCompletions to the runTools/runFunctions options

Screenshot 2023-12-20 at 4 10 47 PM Screenshot 2023-12-20 at 4 10 53 PM

Code snippets

No response

OS

macOS

Node version

v18.16.0

Library version

v4.24.0

tday avatar Dec 20 '23 21:12 tday

Casting the options with maxCompletions to RequestOptions is a workaround.

{ maxChatCompletions: 1 } as RequestOptions

tday avatar Dec 20 '23 21:12 tday

Thanks, we'll try to fix this soon!

rattrayalex avatar Dec 21 '23 04:12 rattrayalex