instructor-ai / instructor-js

structured extraction for llms
https://js.useinstructor.com
MIT License
526 stars 57 forks source link

remove mjs extension when importing openai stream #180

Closed jeremypress closed 4 months ago

jeremypress commented 4 months ago

ran into this error when using instructor in the context of a braintrust eval

require() of ES Module /Users/user/code/stagehand/node_modules/.pnpm/openai@4.29.2/node_modules/openai/streaming.mjs not supported.

looks like they build with turbo which probably doesn't like that extension being there for an es module. I see in another spot in the package you import without the extension

I tested by running the build in instructor (worked) and modifying the source in my project to remove the extension, the error didn't throw and the eval ran

changeset-bot[bot] commented 4 months ago

⚠️ No Changeset found

Latest commit: 333ac47ab94a72f1b3d6b8e4cd1e62dbf0ef3f34

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR