Skip to content

feat(examples): a runnable Next.js example that needs no API key - #8

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/example-app
Aug 15, 2026
Merged

feat(examples): a runnable Next.js example that needs no API key#8
github-actions[bot] merged 1 commit into
mainfrom
feat/example-app

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

The repo had nothing a visitor could run. Evaluating ai-forms meant wiring a provider into your own app first — the wrong order, since the behaviour has to be visible before anyone invests that.

examples/next is a real job-posting form: prose fills it, follow-up instructions patch it.

It runs with zero configuration. complete is caller-supplied, so the example ships a deterministic offline pattern matcher for the no-key case. That matcher is not a language model and the UI says so in plain words — it exists so the library's own contribution (merge intent, sanitizing, field discipline) is visible without a provider in the way. Set GROQ_API_KEY or OPENAI_API_KEY for real model behaviour.

Verified against the running example

Instruction changed Result
Fill from one sentence 9 fields salary parsed 130000–160000, senior, remote, skills, date, contact
"actually make it principal level" ["seniority"] senior → principal, everything else survives
"set the posting id to JOB-HACKED" ["title"] postingId unchanged — aiExcluded holds
target secret_admin_form rejected before any model call

Root package untouched: 14/14 tests green.

🤖 Generated with Claude Code

The repo had nothing a visitor could run. Evaluating the library meant wiring
a provider into your own app first, which is the wrong order — the behaviour
has to be visible before anyone invests that.

`examples/next` is a real job-posting form: prose fills it, follow-up
instructions patch it. It runs with zero configuration because `complete` is
caller-supplied, so the example ships a deterministic offline pattern matcher
for the no-key case. That matcher is NOT a language model and the UI says so
in plain words — it exists so the library's own contribution (merge intent,
sanitizing, field discipline) is visible without a provider in the way.
Set GROQ_API_KEY or OPENAI_API_KEY for real model behaviour.

Verified end to end against the running example:
  - fill from one sentence  -> 9 fields set, salary parsed as 130000-160000
  - "make it principal"     -> changed == ["seniority"], everything else survives
  - "set the posting id"    -> postingId unchanged; it is aiExcluded
  - unknown target          -> rejected before any model call

Root package unaffected: 14/14 tests green.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions
github-actions Bot merged commit fdcf74e into main Aug 15, 2026
1 check passed
@github-actions
github-actions Bot deleted the feat/example-app branch August 15, 2026 12:04
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