-
Notifications
You must be signed in to change notification settings - Fork 3
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
Ways of telling by how much a too-large input is too large #5
Comments
In an separate thread @andreban pointed out that you probably need both. Above I pointed out situations where "more informative errors" is better, but his scenario is
which cannot really be handled without the "measure, then summarize" approach. We'll just have to be sure to put appropriate warnings on the countTokens() API. |
I've put up an initial draft for this in #31. The prompt API will change to align with this. |
It's possible an input fed to these APIs is too large. This will be signaled by a rejected promise, probably a
"QuotaExceededError"
DOMException
.However, @uskay points out that this does not allow you to give informative error messages, telling the user or web developer by how much the input is too large.
There are two possible APIs one could imagine here:
Measure, then summarize
This API is probably bad because it requires two round-trips to the language model, one to tokenize, and then a second one to tokenize-plus-summarize.
More informative errors
This would probably look something like:
This is probably better since it only has one round trip.
The text was updated successfully, but these errors were encountered: