Agent 工具

flue-jev-demo

@matthewp7TypeScript更新于 2026-09-18可当场跑

通过 Cloudflare AI Gateway 使用 TypeSafe Jev 实现 Flue agent 路由管理。

英文原文

Flue agent routing with TypeSafe Jev through Cloudflare AI Gateway

matthewp/flue-jev-demo

它在哪儿调用了 Jev

export const JEV_MODEL = 'typesafe/jev';

src/flue-jev.ts:76

链接指向我们抓取当天的那个 commit,行号是准的。

它问 Jev 的问题

下面是从这个项目源码里原样取出来的 question 组合。

取自 scripts/demo.mjs:73

  1. intent选项

    Which team owns this request?

    • billingCharges, invoices, and refunds
    • technicalBugs, outages, and integrations
    • accountLogin, password, and account access
  2. isUrgent是/否

    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?' },
  },
});

取自 src/agents/support.ts:7

  1. intent选项

    Which support team should handle this request?

    • billingCharges, refunds, subscriptions, invoices, and payment methods
    • technicalBugs, outages, errors, configuration, and integrations
    • humanAmbiguous, sensitive, abusive, or explicitly asks for a person
  2. isUrgent是/否

    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?' },
  },
});

取自 test/flue-jev.test.ts:7

  1. intent选项

    Which team owns this request?

    • billingCharges and refunds
    • technicalBugs and outages
  2. isUrgent是/否

    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?' },
  },
});

同类的其他项目