-
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. |
Let's assume that whatwg/webidl#1465 works out. Then we will have a Should we rename other properties and methods to align with this? Considerations:
Proposal 1:
These are nice and short. However, I'm a bit worried that these names are too generic. Compare So proposal 2 would be to add a prefix, and change a few names to fit better with that prefix:
|
Agreed on all the points mentioned for "Considerations". As you pointed out about the stateful-ness difference between Prompt API and Writing Assistance API, I think proposal (2) covers both APIs better. For example, with proposal (1), it may not be clear that what consumption or usage is exactly for (is it for the whole session?). Also
Or, just sticking with proposal (2) also seems good, for consistent use of the prefix. And between "consumption" and "usage", I prefer "usage"; to me "consumption" sounds like it's also assuming LLM implementation. :) |
Thanks for your thoughts! I really like your hybrid proposal. But I think I slightly prefer (2) with the consistent I will update the relevant PRs now. |
Closes #5. Closes #31 by obsoleting it. Depends on whatwg/webidl#1465.
Closes #5. Closes #31 by obsoleting it. Depends on whatwg/webidl#1465.
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: