不要自建中继
跳过自定义「Jev 代理」。让应用或 serverless 直接指向 Gateway。
让 AI Gateway 成为唯一网络跳。不要为 Jev 自建代理或「中继」API。评估需要 AI SDK evaluate API(AI SDK 7+)。
npm install ai @ai-sdk/gateway import { experimental_evaluate as evaluate } from 'ai';
const result = await evaluate({
model: 'typesafe-ai/jev',
state: 'In stock? Can you ship to the US?',
questions: {
label: {
type: 'choice',
instructions: 'Label this livestream comment for the host team.',
criteria: {
buy_intent: 'Purchase intent, stock availability, or shipping destination questions tied to buying',
price_question: 'Asking about price, discounts, bundles, or deal terms',
after_sales: 'Post-purchase support, returns, defects, delivery problems after buying',
spam: 'Bots, ads, scams, harassment, or irrelevant promotional noise',
other: 'Does not fit the above',
},
},
},
});
// result.answers.label.choice → e.g. "buy_intent"
// high confidence → auto-suggest; low → human queue const result = await evaluate({
model: 'typesafe-ai/jev',
state: 'API returns 500 on checkout',
questions: {
route: {
type: 'choice',
instructions: 'Route this support ticket to the right queue.',
criteria: {
tech: 'Bugs, outages, errors, API failures, integrations, or product not working as designed',
sales: 'Pricing, plans, upgrades, demos, or new-purchase intent before becoming a customer',
billing: 'Charges, invoices, receipts, subscriptions, payment method, or invoice questions',
human: 'Ambiguous, multi-issue, sensitive, legal, account takeover, or otherwise needs a person',
},
},
},
});
// → tech 跳过自定义「Jev 代理」。让应用或 serverless 直接指向 Gateway。
仅建议。退款与收款仍由人负责 — 本包范围外。