Skip to content

Commit

Permalink
fix: use CJS shims for stream (#179)
Browse files Browse the repository at this point in the history
Co-authored-by: Dimitri Kennedy <[email protected]>
  • Loading branch information
morgante and roodboi authored Jun 16, 2024
1 parent d17fefa commit 1b56bd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eighty-zoos-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@instructor-ai/instructor": minor
---

Restore CommonJS compatibility for OpenAI streaming
2 changes: 1 addition & 1 deletion src/instructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1b56bd1

Please sign in to comment.