SDK 与客户端
DSH 包,注册 jev_ask 用于 TypeSafe Jev 的 noul、choice 和 score 答案。
DSH bundle that registers jev_ask for TypeSafe Jev noul, choice, and score answers.
export const DEFAULT_ENDPOINT = 'https://api.typesafe.ai/v1/systemone'链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
department选项Which team should handle this
billing — Payment or subscription issuestechnical — Bugs or integration problemssales — Pricing or account questionsfrustration打分How frustrated the customer appears
0 — Calm, just stating facts1 — Frustrated but civil2 — Very angry, strong languageis_urgent是/否The message conveys urgency or time-sensitivity
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
department: { type: 'choice', instructions: 'Which team should handle this',
criteria: { billing: 'Payment or subscription issues', technical: 'Bugs or integration problems', sales: 'Pricing or account questions' } },
frustration: { type: 'score', instructions: 'How frustrated the customer appears',
criteria: ['Calm, just stating facts', 'Frustrated but civil', 'Very angry, strong language'] },
is_urgent: { type: 'boolean', instructions: 'The message conveys urgency or time-sensitivity' },
},
});is_urgent是/否Does this convey urgency?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
is_urgent: { type: 'boolean', instructions: 'Does this convey urgency?' },
},
});