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 error throwing in summarizeStreaming() #27

Merged
merged 1 commit into from
Jan 17, 2025
Merged

Conversation

domenic
Copy link
Collaborator

@domenic domenic commented Jan 16, 2025

Previously it was returning rejected promises, but this method does not return promises, so it should throw the exceptions instead.

I considered instead returning an immediately-errored ReadableStream. This seems a bit nicer, but a lot of precedent on the web platform points toward throwing. (Actually, most precedent is for methods returning a promise for a ReadableStream, and returning a rejected promise. I cannot find any methods that currently return a ReadableStream synchronously. But throwing is the sync analogue of returning a rejected promise.)


Preview | Diff

Previously it was returning rejected promises, but this method does not return promises, so it should throw the exceptions instead.

I considered instead returning an immediately-errored ReadableStream. This seems a bit nicer, but a lot of precedent on the web platform points toward throwing. (Actually, most precedent is for methods returning a promise for a ReadableStream, and returning a rejected promise. I cannot find any methods that currently return a ReadableStream synchronously. But throwing is the sync analogue of returning a rejected promise.)
@domenic domenic merged commit 9775a8e into main Jan 17, 2025
2 checks passed
@domenic domenic deleted the error-prompt-streaming branch January 24, 2025 03:17
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