Built-in AI task APIs · part 2
Gemini Nano reads a free-form chat message and answers with JSON constrained by a JSON Schema
(responseConstraint). Then a small validator checks what the schema can't: that the order makes sense
and comes from the message. Everything runs on your device. Companion demo for
the blog post
— see README.md.
Prompt API: checking…
Edit it freely, in English or Spanish.
Exactly what prompt() returned, per attempt.
Nothing yet.
Nothing yet.
responseConstraintThe prompt ends with "Reply with JSON only." No schema is sent. The result is run through JSON.parse and the same validator.