openai / openai-node

The official Node.js / Typescript library for the OpenAI API
https://www.npmjs.com/package/openai
Apache License 2.0
7.31k stars 762 forks source link

Async Assistant Streaming Helpers #879

Open metaskills opened 1 month ago

metaskills commented 1 month 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

When using the Assistant Streaming Helpers it is sometimes desirable to have an async/await level of control for the event listener. For example, an imageFileDone listener that would move a file to a new destination as part of tools being submitted.

Additional context

I am the author of Experts.js (https://github.com/metaskills/experts) and I felt this particular pain point in a few of my projects. I've not heard of other's needs for this behavior. That said, I thought that would be helpful for more context.

https://github.com/metaskills/experts?tab=readme-ov-file#streaming--events

Thanks y'all.

meorphis commented 1 month ago

Thanks for reporting @metaskills. I'll route this one to the relevant team to track as a feature request.

rattrayalex commented 1 day ago

Thanks for the suggestion @metaskills . Could you provide a more concrete snippet of the code you'd like to write, and what you have to write today?