Our summary
An app may need to choose a support team rather than write a reply. Flavio Copes shows how the Vercel AI SDK, a shared toolkit for calling AI services, connects to Jev. The app supplies a message and defined questions, then receives choices, ratings or estimates of whether statements are true.
The toolkit changes some names. Jev's yes-or-no question, called Noul, becomes boolean, with its answer in probability. Confidence values for choices and ratings sit in separate provider information, not beside each answer. Direct calls and Vercel's Gateway also use different key names. Keep those keys on the server, not in a visitor's browser.
The sample sends uncertain tickets to a person, but its cutoffs and answer numbers are illustrative. Confidence is not measured accuracy. The web handler checks message length and catches evaluation failures, yet lacks login checks and request limits. Badly formatted incoming data can escape that catch. It is a starting point, not a complete public service.
Key takeaways
- Read the toolkit's names carefully: a yes-or-no question uses boolean and returns probability, while choices and ratings keep their own answer types.
- Use the right key for your route. The AI SDK provider reads TYPESAFE_AI_API_KEY; TypeSafe's own toolkit reads TYPESAFE_API_KEY; Vercel's Gateway uses AI_GATEWAY_API_KEY.
- Pin tested versions and check examples with known answers before routing real work. The evaluation function is experimental and can change even in small package updates.