Jev 模型三原语:判断题、选择题、打分题
Jev 模型的一切能力都可以归结为三种题型原语:判断、选择、打分。TypeSafe AI 围绕这三者设计了模型;一旦你掌握了”问题到原语”的映射,大部分接入决策就自己有了答案。这篇给出每种题型的请求写法和响应形态、怎么在三者之间做选择,以及它们在真实管线里如何组合。所有示例都走 OpenRouter 的 OpenAI 兼容端点。
TL;DR: 判断题返回 yes/no/unclear;选择题返回你枚举的选项之一;打分题返回你定义量表上的数字。每个响应都带 confidence 和 rationale。选择标准就一条:答案空间和你的决策匹配的题型。工作流需要多个决策时,把原语串起来用。
三种题型对比
| 题型 | 答案空间 | 最适合 | 答案示例(示例数据,example fixture) |
|---|---|---|---|
| 判断题 judgment | yes / no / unclear | 闸口检查、标记、审批 | {"answer":"yes","confidence":0.97,"rationale":"..."} |
| 选择题 choice | 列出的选项之一 | 分流、分类、选优 | {"answer":"billing","confidence":0.94,"rationale":"..."} |
| 打分题 scoring | 你定义量表上的数字 | 排序、质量线、优先级 | {"answer":8,"scale":[1,10],"confidence":0.86,"rationale":"..."} |
一条经验法则覆盖大多数情况:答案是是不是,用判断题;是哪一个,用选择题;是有多少,用打分题。
原语一:判断题
判断题是有边界的 yes/no,带一个逃生通道——当输入信息不足时,unclear 是正经答案。
# Confirm the exact model slug on the OpenRouter model page
curl https://openrouter.ai/api/v1/chat/completions \
-H "Authorization: Bearer $OPENROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "typesafe/jev-1.13",
"messages": [
{
"role": "user",
"content": "Judgment question: is this refund request covered by the 30-day policy? Request: \"...\""
}
]
}'
标准的 chat completions 请求;判断语义通过把 content 写成判断问句来传达。
响应——示例数据(example fixture),正式字段名以官方文档为准:
{
"answer": "yes",
"confidence": 0.97,
"rationale": "The purchase date is within 30 days and the item is unopened."
}
判断题适合审核标记、政策检查、重复检测,以及一切”要么放行要么不放行”的闸口。
原语二:选择题
选择题要求你枚举选项。这个约束恰恰是特性:答案保证是选项之一,你的 switch 语句可以放心写。
import json, os, requests
prompt = (
"Choice question: which team should own this email? "
"Options: sales, billing, support. Email: \"...\""
)
resp = requests.post(
"https://openrouter.ai/api/v1/chat/completions",
headers={"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}"},
json={
# Confirm the exact model slug on the OpenRouter model page
"model": "typesafe/jev-1.13",
"messages": [{"role": "user", "content": prompt}],
},
timeout=30,
)
route = json.loads(resp.json()["choices"][0]["message"]["content"])
选项在问题文本里枚举;上线前到 OpenRouter 模型页确认确切的 model slug。
响应——示例数据(example fixture),正式字段名以官方文档为准:
{
"answer": "billing",
"confidence": 0.94,
"rationale": "The email disputes a charge amount rather than asking about a product feature."
}
选择题适合工单分流、意图分类,以及一切”从这个列表里挑一个”的决策。三团队邮件分流的完整落地见 email routing 那个 case。
原语三:打分题
打分题返回你定义量表上的数字,并回带量表本身,避免任何歧义。
import json, os, requests
prompt = "Scoring question (1-10): how well does this FAQ entry answer the user question? Entry: \"...\""
resp = requests.post(
"https://openrouter.ai/api/v1/chat/completions",
headers={"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}"},
json={
# Confirm the exact model slug on the OpenRouter model page
"model": "typesafe/jev-1.13",
"messages": [{"role": "user", "content": prompt}],
},
timeout=30,
)
score = json.loads(resp.json()["choices"][0]["message"]["content"])
量表写在问题措辞里;多次调用保持量表一致,分数才有可比性。
响应——示例数据(example fixture),正式字段名以官方文档为准:
{
"answer": 8,
"scale": [1, 10],
"confidence": 0.86,
"rationale": "The entry answers the core question but skips the edge case mentioned in the question."
}
打分题适合质量线、候选重排和队列排序。
组合使用
真实工作流是把三原语串起来。一个客服管线可以:先判断”这条是不是机器人能处理的?“,再选择负责团队,最后在发送前给草稿回复打分。组合时的思路:
- 判断题当闸口。 先做便宜的 yes/no;unclear 或”否”提前退出转人工。
- 选择题当分叉。 过了闸口再路由给正确的负责人。
- 打分题当质量线。 在出口给结果打分,低于阈值就扣下。
每次调用只用一种原语——把选择题和打分混在一个问题里,会让答案空间变浑、confidence 也变难解释。题干措辞、选项枚举和 few-shot 示例的深入讨论见《Jev 问题设计与状态管理》。
本文适用版本 Jev 1.13。