Skip to content

API Reference parrot.clients.jev.models

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.clients.jev.models

View source

Wire models for TypeSafe AI's System One API, served by the Jev model.

The shapes mirror https://api.typesafe.ai/openapi.json (as reproduced by the official typesafe-sdk generated schemas): three question primitives — noul (yes/no), choice (one of N labels) and score (ordered rubric) — their tagged answers, and the /v1/systemone request/response envelopes. Every model is Pydantic v2 so questions can be declared, validated and serialized without the vendor SDK.

Attribute Answer

An answer, identified by its type discriminator.

Class Choice

Pick exactly one label out of a fixed set.

Example::

Choice(
    instructions="What is this ticket about?",
    criteria={"billing": "Payments and invoices", "technical": None, "other": None},
)

Attributes:

Attribute Type Description
type Literal['choice']
criteria Dict[str, Optional[JSONContent]]

Class ChoiceAnswer

Answer to a :class:Choice question.

Fields:

Field Type Default Description
type Literal['choice'] 'choice'
choice str The selected label.
confidence float Reported confidence in the selected label.
probabilities Dict[str, float] Probability per label.

Attributes:

Attribute Type Description
value str The plain answer value: the selected label.

Attribute JSONContent

Alias JevConfigurationError

Re-exported from parrot.clients.jev.exceptions.JevConfigurationError.

Class JevModel

TypeSafe System One model names accepted by the model field.

String-valued so members interchange with raw model strings. Every model is served by the same POST /v1/systemone endpoint. Aliases move when a new release ships; the response's model field always reports the versioned ID that answered, so pin a version (JEV_1_13) when you have tuned confidence thresholds against it.

Attributes:

Attribute Type Description
JEV_LATEST Alias: the most recent stable, official release (SDK default). Currently jev-1.13.0.
JEV_PREVIEW Alias: the most recent release, preview or not. Currently the same as jev-latest.
JEV_1_13 Jev 1.13 — versioned ID, accepted whether or not GET /v1/models lists it.

Class JevUsage

Token accounting reported by the API (output tokens are free).

Fields:

Field Type Default Description
input_tokens Optional[int] None Input tokens consumed, when reported.
output_tokens Optional[int] None Output tokens, when reported.
billing_units Optional[int] None Billing units, when reported.

Class ListModelsResponse

The models available to the account.

Fields:

Field Type Default Description
models List[ModelMetadata] Available models.

Attribute MAX_CHOICE_OPTIONS

Attribute MAX_REQUEST_TOKENS

Context budget per request: state plus all questions combined (64k).

Attribute MAX_STATE_PLUS_QUESTION_TOKENS

Budget for state plus the single longest question (32k).

Attribute MODEL_ALIASES

Type: Dict[str, str]

Class ModelMetadata

One entry of GET /v1/models.

Fields:

Field Type Default Description
name str Model route, e.g. jev-latest.
description str '' Human-readable description.
release_date str '' Release date as reported by the API.

Class Noul

A yes/no question. The answer is the probability of yes.

Example::

Noul(instructions="Does the customer ask for a refund?")

Attributes:

Attribute Type Description
type Literal['noul']
criteria Optional[NoulCriteria]

Method Noul.to_wire

Serialize, dropping an absent or fully-empty criteria block.

to_wire() -> Dict[str, Any]

Returns: Dict[str, Any]

Class NoulAnswer

Answer to a :class:Noul question.

Fields:

Field Type Default Description
type Literal['noul'] 'noul'
noul float Probability of a yes answer, from zero to one.

Attributes:

Attribute Type Description
value float The plain answer value: the yes probability.

Method NoulAnswer.is_yes

Decide the boolean at threshold (inclusive).

is_yes(threshold: float = 0.5) -> bool

Parameter Type Default Description
threshold float 0.5

Returns: bool

Class NoulCriteria

Optional descriptions of the yes and no outcomes of a noul question.

Fields:

Field Type Default Description
true Optional[JSONContent] None Description of the yes outcome.
false Optional[JSONContent] None Description of the no outcome.

Attribute PRICE_USD_PER_MTOK

List price per million input tokens (output is free).

Attribute Question

Any of the three question primitives.

Attribute QuestionInput

A question object or its plain dict form ({"type": "choice", ...}).

Attribute RATE_LIMIT_REQUESTS_PER_MINUTE

Documented request rate limit; exceeding it returns 429 Too Many Requests.

Attribute RATE_LIMIT_TOKENS_PER_SECOND

Documented token rate limit; exceeding it returns 429 Too Many Requests.

Class Score

Place the state on an ordered rubric; level i is criteria[i].

Example::

Score(
    instructions="How severe is the reported problem?",
    criteria=["Cosmetic", "Degraded but usable", "Blocked, no workaround"],
)

Attributes:

Attribute Type Description
type Literal['score']
criteria List[JSONContent]

Class ScoreAnswer

Answer to a :class:Score question.

Fields:

Field Type Default Description
type Literal['score'] 'score'
score float Expected score; may fall between the integer rubric levels.
confidence float Reported confidence in the score.
legend Dict[int, JSONContent] Rubric descriptions keyed by level.
probabilities Dict[int, float] Probability per integer level.

Attributes:

Attribute Type Description
value float The plain answer value: the expected score.
level int The nearest integer rubric level.

Class SystemOneResponse

A POST /v1/systemone response: answers keyed by question id.

Fields:

Field Type Default Description
model str The model that answered the request.
answers Dict[str, Answer] Answers keyed by question id.
usage JevUsage Token usage for the request.
request_id Optional[str] None Server request id (from the response header).

Attributes:

Attribute Type Description
nouls Dict[str, NoulAnswer] Yes/no answers keyed by question id.
choices Dict[str, ChoiceAnswer] Choice answers keyed by question id.
scores Dict[str, ScoreAnswer] Score answers keyed by question id.

Method SystemOneResponse.values

Plain answer values keyed by question id (label, score, or yes-probability).

values() -> Dict[str, Union[str, float]]

Returns: Dict[str, Union[str, float]]

Attribute logger

Function normalize_questions

Validate a question map and serialize it for the request body.

normalize_questions(questions: Mapping[str, QuestionInput]) -> Dict[str, Dict[str, Any]]

Parameter Type Default Description
questions Mapping[str, QuestionInput] Questions keyed by the id their answers will be returned under.

Returns: Dict[str, Dict[str, Any]] — {name: wire_dict} ready to be JSON-encoded.

Raises:

  • JevConfigurationError — When the map is empty or a question is invalid.

Function parse_question

Coerce a question object or dict into a validated primitive.

parse_question(name: str, question: QuestionInput) -> Question

Parameter Type Default Description
name str The question id, used only in error messages.
question QuestionInput A :class:Noul / :class:Choice / :class:Score instance or a mapping with a type discriminator.

Returns: Question — The validated question instance.

Raises:

  • JevConfigurationError — When the mapping is not a valid question.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally