Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): polyfill Web Stream APIs #777

Merged

Conversation

himself65
Copy link
Member

@himself65 himself65 commented Apr 27, 2024

feedback from: https://discord.com/channels/1059199217496772688/1133167189860565033/1233430729879453738

Reason is lower version typescript doesn't have built-in async iterator support for Readable Stream

This PR will restrict the type check by set types to empty array, and remove "DOM" on the top config to make sure each sub-module uses correct types

Copy link

changeset-bot bot commented Apr 27, 2024

⚠️ No Changeset found

Latest commit: 0697d4c

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

Copy link

vercel bot commented Apr 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
llama-index-ts-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 28, 2024 11:46pm

@himself65 himself65 changed the title fix: stricter type for packages fix: polyfill Web Stream APIs Apr 28, 2024
Copy link
Member Author

@himself65 himself65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

find a bug when running streaming mode, fixing

Comment on lines +73 to +80
const output = stepOutput.output;
if (output instanceof ReadableStream) {
for await (const chunk of output) {
process.stdout.write(chunk.delta);
}
} else {
console.log(output);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems ugly to use, but since this not for user side API, I think it's okay for now

@himself65 himself65 changed the title fix: polyfill Web Stream APIs fix(core): polyfill Web Stream APIs Apr 28, 2024
@himself65 himself65 merged commit dccb816 into run-llama:main Apr 28, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant