Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using polyfills for Node.js #951

Closed
1 task done
mcollina opened this issue Jul 24, 2024 · 5 comments
Closed
1 task done

Stop using polyfills for Node.js #951

mcollina opened this issue Jul 24, 2024 · 5 comments

Comments

@mcollina
Copy link

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

  • This is a feature request for the Node library

Describe the feature or improvement you're requesting

My understanding is that this module use polyfills for Node.js.
There is no need for doing so given you support Node.js v18+.

This causes compatibility issues with the rest of the ecosystem.

Ref fastify/fastify#5584

Additional context

No response

@RobertCraigie
Copy link
Collaborator

RobertCraigie commented Jul 24, 2024

Hi @mcollina, see #392 for some context. We were originally thinking about depending on undici but it looks like we'll be able to depend entirely on builtins.

Unfortunately that change won't land particularly quickly, is there anything we could to do in the meantime to be compatible with fastify?

@mcollina
Copy link
Author

mcollina commented Jul 24, 2024

The problem is not actually in fastify. We call Readable.fromWeb().

I think providing a default utility to get a Node.js stream instead would remove the problem.

@Ethan-Arrowood
Copy link

👋 Hi Matteo!

Hopefully removing the polyfill will fix that user's issue. As @RobertCraigie mentioned, more work is happening behind the scenes to align the SDK with more Node.js built-ins and align on web standard APIs so the SDK is interoperable between any JS Runtime environment.

Keep an eye out for future updates 🚀

@RobertCraigie
Copy link
Collaborator

@mcollina this will be fixed in the next release :)

#949

@RobertCraigie
Copy link
Collaborator

This was fixed in v4.53.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants