开源复现

OpenDecision

@deepanwadhwa29PythonApache-2.0更新于 2026-09-19可当场跑

OpenDecision 是一个开源语义决策引擎,类似于 TypeSafe 的 Jev。

英文原文

OpenDecision is an open-source semantic decision engine like typesafe's jev.

deepanwadhwa/OpenDecision

它在哪儿调用了 Jev

"/v1/systemone",

src/opendecision/api/app.py:82

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 examples/m3_typesafe_sdk_demo.py:9

  1. department选项

    Which department should handle this?

    • billingPayments and refunds
    • technicalSoftware problems
    • salesPurchasing questions
  2. urgent是/否

    This request is time-sensitive.

  3. frustration打分

    How frustrated is the customer?

    • 0Calm
    • 1Frustrated
    • 2Extremely angry

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    department: { type: 'choice', instructions: 'Which department should handle this?',
      criteria: { billing: 'Payments and refunds', technical: 'Software problems', sales: 'Purchasing questions' } },
    urgent: { type: 'boolean', instructions: 'This request is time-sensitive.' },
    frustration: { type: 'score', instructions: 'How frustrated is the customer?',
      criteria: ['Calm', 'Frustrated', 'Extremely angry'] },
  },
});

同类的其他项目