@anvia/jev
v0.2.0
Published
Jev decision model adapter for Anvia.
Readme
@anvia/jev
Use Jev for typed decisions in ordinary applications: classification, tagging, routing,
prioritization, record matching, and verification. Create a decision model and pass it to
Anvia's provider-neutral decide() operation.
Install
pnpm add @anvia/jev @anvia/coreThe adapter uses the official @typesafe-ai/sdk and requires Node.js 20 or newer.
Quickstart
Set TYPESAFE_API_KEY in your server environment.
import { JevClient, JEV_LATEST } from "@anvia/jev";
import { choice, decide } from "@anvia/core/decision";
const client = new JevClient({ apiKey: process.env.TYPESAFE_API_KEY });
const model = client.decisionModel({ modelId: JEV_LATEST });
const { answers } = await decide({
model,
state: { message: "Please refund my duplicate payment." },
questions: {
department: choice({
instructions: "Which department should handle this?",
options: {
billing: "Payments, invoices, and refunds",
technical: "Product bugs and technical support",
general: "Other requests",
},
}),
},
});
console.log(answers.department.choice); // "billing" | "technical" | "general"
console.log(answers.department.confidence);Capabilities
- Native choice, rubric score, and boolean probability questions.
- Multiple labels composed from one independent Noul question per label in the same request.
- Mixed questions, normalized token usage, and the original SDK result in
rawResponse. - Model listing, custom endpoints, headers, and an injected
TypeSafeClient. - Core-controlled retries, cancellation, and ordered batch execution.
