Skip to content

Jev directory

Jev Msw

Contract-aware MSW handlers for the official @typesafe-ai/sdk: mock Jev choices, Nouls and scores in tests without API calls, credentials, latency or credits, while the real SDK parsing and retry logic still runs.
Stars
2
Language
TypeScript
License
MIT
Reading time
2 min
Published by
Community
Author
royalpinto007
Last verified
Oct 2026

Highlights

  • Provides jev.choice, jev.noul, jev.score and jev.respond handlers for the real @typesafe-ai/sdk, so parsing, error, timeout and retry logic still run.
  • Missing probability maps, score legends, score probabilities, model and zero-token usage are derived from labels in the incoming question.
  • jev.mock supports dynamic decisions with deep-partial or predicate matchers for state, questions and model, plus delay and attempt-aware answers.
  • Failure helpers cover serverError, rateLimited, error(422), connectionError, timeout and malformed; sequence() replays a chain and sticks on the end.
  • jev.history exposes requests and lastRequest; development setup needs only jev-msw and msw as dependencies.

Quickstart

ts
import { TypeSafeClient } from "@typesafe-ai/sdk";
import { jev } from "jev-msw";

const client = new TypeSafeClient({ apiKey: "test-key" });
server.use(jev.choice("category", { choice: "billing", confidence: 0.96 }));

Watch out

Copy reviewed against the truncated repo README on 2026-10-15; the excerpt cuts off inside the request-inspection section, so one custom matcher export is only partially visible. The README positions the handlers as supporting the official SDK's documented retry surface rather than every SDK version.

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