Skip to content

Docs

jev: Function-to-Question Decorator

@jev.fn compiles a Python function definition (parameters, docstring, return annotation) into a state plus typed questions, then validates the answers back into Pydantic models.
Format
Docs
Reading time
3 min
Published by
Community
Last verified
Sep 2026

Highlights

  • Install is `pip install jev` / `uv sync`; the package requires Python 3.14 and was released Sep 18, 2026 as version 0.3.0.
  • Field types map to question types: bool to Noul, Literal and Enum to Choice, and bounded int or float to Score.
  • Limits are 255 options per choice and 256 levels per score; exceeding either raises TypeError at decoration time.
  • `.map()` applies the function to a list in one call and returns results in input order, with no documented batch limit.
  • Calibrated probabilities never reach you: bool is thresholded (default 0.5), Choice takes the argmax, and Score returns the expected value.

Quickstart

python
from typing import Literal
from pydantic import BaseModel, Field
import jev

class Triage(BaseModel):
    department: Literal["billing", "technical", "sales"]
    is_urgent: bool
    frustration: int = Field(ge=0, le=2)

jev.decide("I was charged twice. Fix this NOW.", Triage)
# Triage(department='billing', is_urgent=True, frustration=2)

Watch out

Calibrated probabilities and confidence scores are discarded, and unsupported return types raise TypeError at import time, so confidence-gated routing needs the raw SDK.

Questions about this entry

Short answers drawn from the linked project or page.

From the Jev guides

Original write-ups on what this entry is for.

From the Jev AI model community

Posts from builders shipping with Jev right now.

Follow @typesafeai