Skip to content

Commit 1b56bd1

Browse files
morganteroodboi
andauthored
fix: use CJS shims for stream (#179)
Co-authored-by: Dimitri Kennedy <[email protected]>
1 parent d17fefa commit 1b56bd1

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/eighty-zoos-walk.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@instructor-ai/instructor": minor
3+
---
4+
5+
Restore CommonJS compatibility for OpenAI streaming

src/instructor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
ReturnTypeBasedOnParams
1010
} from "@/types"
1111
import OpenAI from "openai"
12-
import { Stream } from "openai/streaming.mjs"
12+
import { Stream } from "openai/streaming"
1313
import { z, ZodError } from "zod"
1414
import ZodStream, { OAIResponseParser, OAIStream, withResponseModel, type Mode } from "zod-stream"
1515
import { fromZodError } from "zod-validation-error"

0 commit comments

Comments
 (0)