Agent 工具
通过 Cloudflare AI Gateway 使用 TypeSafe Jev 实现 Flue agent 路由管理。
Flue agent routing with TypeSafe Jev through Cloudflare AI Gateway
export const JEV_MODEL = 'typesafe/jev';链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
intent选项Which team owns this request?
billing — Charges, invoices, and refundstechnical — Bugs, outages, and integrationsaccount — Login, password, and account accessisUrgent是/否Does this request need immediate attention?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
intent: { type: 'choice', instructions: 'Which team owns this request?',
criteria: { billing: 'Charges, invoices, and refunds', technical: 'Bugs, outages, and integrations', account: 'Login, password, and account access' } },
isUrgent: { type: 'boolean', instructions: 'Does this request need immediate attention?' },
},
});intent选项Which support team should handle this request?
billing — Charges, refunds, subscriptions, invoices, and payment methodstechnical — Bugs, outages, errors, configuration, and integrationshuman — Ambiguous, sensitive, abusive, or explicitly asks for a personisUrgent是/否Does this request need immediate attention?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
intent: { type: 'choice', instructions: 'Which support team should handle this request?',
criteria: { billing: 'Charges, refunds, subscriptions, invoices, and payment methods', technical: 'Bugs, outages, errors, configuration, and integrations', human: 'Ambiguous, sensitive, abusive, or explicitly asks for a person' } },
isUrgent: { type: 'boolean', instructions: 'Does this request need immediate attention?' },
},
});intent选项Which team owns this request?
billing — Charges and refundstechnical — Bugs and outagesisUrgent是/否Does this need immediate attention?
import { experimental_evaluate as evaluate } from 'ai';
const { answers } = await evaluate({
model: 'typesafe-ai/jev',
state,
questions: {
intent: { type: 'choice', instructions: 'Which team owns this request?',
criteria: { billing: 'Charges and refunds', technical: 'Bugs and outages' } },
isUrgent: { type: 'boolean', instructions: 'Does this need immediate attention?' },
},
});