diff --git a/.changeset/eighty-zoos-walk.md b/.changeset/eighty-zoos-walk.md new file mode 100644 index 00000000..dc706e0f --- /dev/null +++ b/.changeset/eighty-zoos-walk.md @@ -0,0 +1,5 @@ +--- +"@instructor-ai/instructor": minor +--- + +Restore CommonJS compatibility for OpenAI streaming diff --git a/src/instructor.ts b/src/instructor.ts index 6b7313b0..c5568c0a 100644 --- a/src/instructor.ts +++ b/src/instructor.ts @@ -9,7 +9,7 @@ import { ReturnTypeBasedOnParams } from "@/types" import OpenAI from "openai" -import { Stream } from "openai/streaming.mjs" +import { Stream } from "openai/streaming" import { z, ZodError } from "zod" import ZodStream, { OAIResponseParser, OAIStream, withResponseModel, type Mode } from "zod-stream" import { fromZodError } from "zod-validation-error"