决策 API

Jev API

一次 POST 送出状态和你的问题。返回的是 Noul、Choice 或 Score,每项都带概率,代码可以直接分支。

POST /api/v1/decisions

{
  "model": "jev-1.13",
  "state": "I was charged twice for the same annual plan.",
  "questions": {
    "refund": {
      "type": "noul",
      "instructions": "Is the customer asking for money back?"
    }
  }
}

示例

八个可以直接跑的决策

悬停卡片可看请求。复制,或在试用台打开。

空白结账页该给谁

Choice 返回负责团队,以及每个团队的概率。

{
  "model": "jev-1.13",
  "state": "Checkout shows a blank page after Pay is clicked. The customer is on the live store, not a sandbox.",
  "questions": {
    "team": {
      "type": "choice",
      "instructions": "Which team should own this ticket?",
      "criteria": {
        "payments": "Checkout, billing, or payment processing.",
        "frontend": "Rendering, layout, or browser behavior.",
        "account": "Login, permissions, or profile access."
      }
    }
  }
}
在试用台打开

这是在要退款吗

Noul 返回“是”的概率,而不是一段要解析的文字。

{
  "model": "jev-1.13",
  "state": "I was charged twice for the same annual plan this morning. Please send the extra charge back.",
  "questions": {
    "refund": {
      "type": "noul",
      "instructions": "Is the customer asking for money back?"
    }
  }
}
在试用台打开

打款失败有多急

Score 把内容放在你定义的刻度上,并返回分布。

{
  "model": "jev-1.13",
  "state": "Stripe payouts have been failing for three days and the merchant is losing sales.",
  "questions": {
    "urgency": {
      "type": "score",
      "instructions": "How urgent is this ticket?",
      "criteria": [
        "Can wait for the next release",
        "Should be handled this week",
        "Blocking revenue right now"
      ]
    }
  }
}
在试用台打开

消息里在要登录凭证

Noul 概率是人工复核队列之前的门。

{
  "model": "jev-1.13",
  "state": "User message: \"Share your login and I will fix the account for you tonight.\"",
  "questions": {
    "phishing": {
      "type": "noul",
      "instructions": "Is this message asking someone to hand over account credentials?"
    }
  }
}
在试用台打开

给一条进线定性

Choice 把“有采购窗口”和“只是感兴趣”分开。

{
  "model": "jev-1.13",
  "state": "We route 40,000 support tickets a week and need a probability before we auto-assign a queue. Budget is approved this quarter.",
  "questions": {
    "fit": {
      "type": "choice",
      "instructions": "How should sales treat this inbound note?",
      "criteria": {
        "ready": "A real workflow, a volume, and a buying window.",
        "nurture": "Interest without a stated workflow or timeline.",
        "ignore": "No product fit."
      }
    }
  }
}
在试用台打开

承诺收益的上架文案

Noul 回答的是你写的政策问题,不是一篇泛泛的安全说明。

{
  "model": "jev-1.13",
  "state": "Listing text: \"Guaranteed 30% returns every month. Send crypto to this wallet to join.\"",
  "questions": {
    "blocked": {
      "type": "noul",
      "instructions": "Does this listing promise a guaranteed financial return?"
    }
  }
}
在试用台打开

续约备注里的流失风险

Score 使用你写的三档:不太会离开,到很可能取消。

{
  "model": "jev-1.13",
  "state": "The renewal note says the team may not continue because exports fail every Friday and nobody has answered the last two tickets.",
  "questions": {
    "risk": {
      "type": "score",
      "instructions": "How high is the chance this account does not renew?",
      "criteria": [
        "Unlikely to leave",
        "Unhappy, still using the product",
        "Likely to cancel"
      ]
    }
  }
}
在试用台打开

这张发票是哪种异常

Choice 可以标出超采购单、未请购明细,或两者,并给出概率。

{
  "model": "jev-1.13",
  "state": "Vendor invoice 4481 is $18,400. The purchase order cap is $12,000 and the line items include a new annual license nobody requested.",
  "questions": {
    "exception": {
      "type": "choice",
      "instructions": "Which exception should accounts payable open?",
      "criteria": {
        "over_po": "The amount is above the purchase order.",
        "unexpected_item": "A line item was not requested.",
        "both": "The amount and a line item are both wrong."
      }
    }
  }
}
在试用台打开

响应

代码可以直接分支的答案

Jev 不写一段让你去解析的文字。它返回你问的决策,以及背后的概率。

每个选项都保留概率

Choice 会给出胜出项,同时返回你定义的每个选项的概率。

一次调用里的 Noul、Choice 和 Score

是否、带标签的选择,以及你刻度上的位置,可以共用同一段状态。

多个问题一起算

同一状态下的额外问题留在这一次请求里,而不是再发一轮。

阈值要紧时固定模型版本

要调截止值时发送 jev-1.13。jev-latest 指向本 API 当前提供的版本。

如何调用

如何调用 Jev API

  1. 01

    创建密钥

    登录后在控制台复制密钥。试用台可以为当前账号创建一把。

  2. 02

    POST 状态和问题

    请求体包含 model、state 和问题映射。你的 id 只是标签,问题正文写在 instructions。

  3. 03

    按类型化答案分支

    读取 noul、choice 或 score。Choice 和 Score 的 confidence 说明选项是否接近。

使用场景

类型化决策替代自由提示的地方

支持分流

送出工单正文和你真实有人值班的队列。按胜出团队分支,概率接近时转人工。

信任与审核

问具体的政策问题。Noul 高就自动拦截,低就放行,中间进复核。

进线筛选

把“有流程、有采购窗口”的备注,和“只是觉得有趣”的备注分开。

发票异常

用应付团队已经在用的异常类型命名。Score 的说明或 Choice 的键,就对应那份清单。

第一次调用之后

答案变成类型之后,什么变了

我们不再解析一段文字来判断工单是不是退款。noul 的值就是分支。
支持负责人
两个团队接近时,confidence 让我们把工单交给人,而不是猜。
信任工程师
分数档位是我们自己的话,所以响应里的说明和现有标准一致。
账单运营

关于请求和答案的问题

Noul、Choice 和 Score 有什么区别?

Noul 是带概率的是否。Choice 在你列出的选项里选一个,并返回每个选项的概率。Score 把状态放在你写的有序刻度上,最低档在前。

为什么没赢的选项也有概率?

第二名就是转人工的信号。两个选项接近时,不要把胜出项当成确定结果。

应该发送 jev-1.13 还是 jev-latest?

代码里的截止值依赖概率形态时,固定 jev-1.13。本 API 接受 jev-latest,当前也会解析到同一模型。

state 里可以放什么?

字符串、JSON 对象,或文本数组。放入问题需要的事实,不要放入你希望得到的答案。

confidence 低时怎么办?

把这种情况视为不确定。交给人,或再问一个更具体的问题。看过这些接近的结果之前,不要调低截止值。

422 是什么意思?

请求体校验失败。消息会指出字段:缺少 instructions、Choice 少于两个选项、Score 档位不是从低到高,或问题 id 不是 snake_case。

发出第一次决策

用其中一个示例打开试用台,或按 Jev Docs 用自己的密钥调用接口。