Release of openai-node v4.0.0.0

Version 4 is a complete rewrite of the SDK, offering a huge set of improvements.

What’s new

  • Streaming support for completions and chat completions!
  • Improved typescript types for responses & errors
  • Support for ESM, CloudFlare Workers, Vercel edge functions, Deno, and more
  • Better file upload API for Whisper, fine-tune files, & DALL·E images
  • Improved error handling through automatic retries & error classes
  • Improved latency through reusing TCP connections
  • Simpler initialization logic

Now I suspect this is important but I’m not sure why. Does it mean I need to migrate all my .js files that use OpenAI?

2 Likes

Still looking into this myself, I think it need migrating if you update the SDK/Libs, yes.

There’s a migration guide and automatic migration tool available here: v3 to v4 Migration Guide · openai/openai-node · Discussion #217 · GitHub

2 Likes