openai / openai-node

Official JavaScript / TypeScript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
7.93k stars 862 forks source link

[Important] Add max_prompt_tokens and max_completion_tokens for Runs API #765

Closed neilord closed 6 months ago

neilord commented 6 months ago

Confirm this is a feature request for the Node library and not the underlying OpenAI API.

Describe the feature or improvement you're requesting

Hi, I belive that max_prompt_tokens and max_completion_tokens are essential features for using the whole Assistants API. Without being able to specify the max tokens, the thread is just getting longer, and running the AI model getting very expensive. Please add the max_prompt_tokens and max_completion_tokens parameters to the openai.beta.threads.runs.create. Thanks!

Additional context

No response

rattrayalex commented 6 months ago

I believe @pstern-sl is working on this.

pstern-sl commented 6 months ago

This is available starting in version 4.34 - released today https://github.com/openai/openai-node/pull/767

neilord commented 6 months ago

Awesome! Thanks a lot for implementing this! :)