Scott Fortmann-Roe
unread,Jul 25, 2025, 11:26:11 AMJul 25Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chrome Built-in AI Early Preview Program Discussions, Die4Ever2005, Thomas Steiner, Chrome Built-in AI Early Preview Program Discussions
+1 to this
One use case we have is where we're building a spell checker and we want the response to be of the form:
User: {"input: "[Input to correct]"}
Assistant: {"corrected": "[The corrected output]"}
We can use responseConstraint to guarantee the correct output form.
Now, if we correct some content for the user and then the user adds new content at the end of it, we want to correct the new content without having to re-correct the old content.
To do this, we want to be able to do the following:
User: {"input: "[Already corrected input][Added input]"}
Assistant Prefix: {"corrected": "[Already corrected output] <-- we include the already corrected output as a prefix so it's not recomputed, we don't terminate the JSON object
Assistant Generated: [Corrected added input]"} <-- the assistant just generates the corrected form of the added text and then closes the JSON object
Thanks! Scott