@formio/uag-jev

中文文档
2.0.0发布于 2026/11/13MITCommonJS构建来源已验证近 30 天下载 2058

TypeSafe Jev decision engine for the Form.io Universal Agent Gateway (UAG): fast, confidence-scored Choice, Score and yes/no decisions for the Agent API.

原始使用文档
文档目录5 节
  1. Settings
  2. Instances
  3. Pin the model
  4. How it works
  5. Using it in your own server

@formio/uag-jev

Form.io UAG › Engines › this page

The TypeSafe Jev decision engine for the UAG Agent API. It answers a task's closed-set fields (radio, select, checkbox, select boxes, survey and small resource selects) in one request, typically in 70–500 ms, with a confidence for each answer.

It is included in the formio/uag Docker image. With the UAG installed from npm, install it next to it:

npm install @formio/uag-jev

Enable it by naming it, and set its key:

UAG_ENGINES=jev
TYPESAFE_API_KEY=...

Decisions are Agentic Formflow, so on a self-hosted project the UAG also needs a LICENSE_KEY that includes the UAG for the project's endpoint (see Licensing); a project on Form.io's hosted service needs none.

Settings

SettingVariablesDefault
apiKeyUAG_ENGINE_<NAME>_API_KEY, TYPESAFE_API_KEYrequired (secret)
modelUAG_ENGINE_<NAME>_MODEL, TYPESAFE_MODELjev-1.13.0
baseURLUAG_ENGINE_<NAME>_BASE_URL, TYPESAFE_BASE_URLthe SDK's default

<NAME> is the instance name, upper-cased with - as _. An instance's own variable wins over the shared one.

The SDK's request timeout follows the instance's routing timeout (routing.timeouts.<name>, else agentApi.timeout, else 30 seconds; always 30 seconds on an engine server), so its retries of rate-limit and overload responses never outlast it. After the timeout, the UAG falls back to the next engine.

Instances

Run a second Jev model next to the first, for example to compare a new version on live traffic before switching:

UAG_ENGINES=jev,next:jev
TYPESAFE_API_KEY=...
UAG_ENGINE_NEXT_MODEL=jev-1.14.0

Routing lists name the instances: routing.decision: ["next", "jev"].

Pin the model

Behavior differs between Jev versions. Keep model at a dated version, and run uag-eval on your own labeled examples before changing it or any threshold. uag-eval --engine jev works from a checkout of the UAG repository or inside the formio/uag image:

docker run --rm --entrypoint node -v "$PWD:/data" -e TYPESAFE_API_KEY -e LICENSE_KEY formio/uag \
  --no-node-snapshot bin/uag-eval.js --form /data/claim.json --examples /data/claim-examples.json \
  --engine jev --project <your project URL>

uag-eval needs a LICENSE_KEY that includes the UAG for that project's endpoint.

How it works

The UAG builds the questions and interprets the answers; this package only maps them to and from @typesafe-ai/sdk. Answers outside the options asked are dropped, and scores are kept within their levels. Jev's confidence is already normalized against an even split, which is what the UAG's confidence threshold expects, so it is passed on unchanged.

Errors: a refused API key (401, 403), a rate limit (429) and a TypeSafe server failure (5xx) reach API callers as that, with no response body; any other failure is reported only as "the engine failed". Retries never wait longer than the request timeout for a Retry-After.

Data residency: Jev is a hosted service. Each request sends TypeSafe:

  • the task's criteria and today's date;
  • the values at its uagContext paths;
  • its input fields, or, for a task with no input, the whole submission except the fields being decided.

Deployments that cannot send data there should not enable this engine; decision fields then fall back to an agent engine.

Logging: leave TYPESAFE_LOG_LEVEL unset (or warn) in production. At debug, the TypeSafe SDK writes each request and response body, which hold submission data, to the console.

Using it in your own server

Name it in configuration instead of UAG_ENGINES, with options that take precedence over the environment:

const server = new UAGServer({ engines: [{ name: 'jev', type: 'jev', options: { model: 'jev-1.13.0' } }] });

License: MIT.

版本与发布记录

@formio/uag-jev 共发布 13 个版本,首次发布于 2026/10/30;过去 12 个月发布了 13 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.0.0latest2026/11/132 天前
2.0.0-rc.11rc2026/11/105 天前
2.0.0-rc.102026/11/087 天前
2.0.0-rc.92026/11/079 天前
2.0.0-rc.82026/11/069 天前
2.0.0-rc.72026/11/0610 天前

关于 @formio/uag-jev 的常见问题

@formio/uag-jev 是什么?

TypeSafe Jev decision engine for the Form.io Universal Agent Gateway (UAG): fast, confidence-scored Choice, Score and yes/no decisions for the Agent API.

如何安装 @formio/uag-jev?

在项目目录运行 npm install @formio/uag-jev,或使用 pnpm add / yarn add / bun add。

@formio/uag-jev 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/formio__uag-jev 是否存在。

@formio/uag-jev 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@formio/uag-jev 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@formio/uag-jev 可以商用吗?

@formio/uag-jev 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@formio/uag-jev 的下载量有多少?

根据 npm 官方下载统计,@formio/uag-jev 在 2026/10/16 – 2026/11/14 这 30 天内被下载 2,058 次,日均约 69 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@formio/uag-jev 还在维护吗?

最新版本 2.0.0 发布于 2026/11/13(2 天前);至今共发布 13 个版本,其中过去 12 个月发布了 13 个;首次发布于 2026/10/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。