How to Get Started With Jev in Python (Real Python)
External Real Python tutorial by Philipp Acsany (updated 2026-09-24): connect a Python script to hosted TypeSafe Jev through the TypeSafe SDK and OpenRouter, replace a rigid Y/N check with Noul, then ask Choice, Score, and Noul together in one request.
What this guide points to
Philipp Acsany published How to Get Started With Jev in Python on Real Python (updated 2026-09-24; Real Python also shared it on X on 2026-11-09). It is an intermediate, about-18-minute walkthrough that starts with a train-station script that only accepts uppercase Y or N, then hands the visitor’s reply to hosted TypeSafe Jev.
Worked steps in the article:
- Project setup — Python 3.10+,
uv,typesafe-sdk==0.7.1, and an OpenRouter key in.envasOPENROUTER_API_KEY. The SDK default isjev-latest; you can pin a version such asjev-1.13. - One Noul question —
TypeSafeClientwithbase_url="https://openrouter.ai/api"; put only the visitor’s answer instate; use cutoffs such as above 0.8 / below 0.2, and ask again in the middle band. - Instruction wording — the article shows why “Is the answer affirmative?” works on a bare “yes”, while “Did the user lose something?” can leave a short yes in the mid band, because the original prompt never reaches Jev.
- Choice, Score, and Noul in one call — route a visitor to a desk, score urgency, and test whether they need assistance; then print typed answers (
choice,score,noul) instead of prose. - Troubleshooting — missing
typesafe_sdk, unsetOPENROUTER_API_KEY,TypeSafeAuthenticationErrorwhen the key orbase_urlis wrong, empty credits, and rate limits.
This page is an unofficial handbook pointer — verify against the article and TypeSafe docs. Do not paste long tutorial snippets here; open the source and follow it live.
Takeaways
- Jev returns typed numbers and option keys; your Python code turns them into the next action.
- Put the visitor’s words in state and the judgment in the question; keep the original prompt out of the way unless you also pass it in state.
- One
system_onerequest can carry Noul, Choice, and Score together.