Agent 工具

grok-bot-jev

@Bodila5125PythonMIT更新于 2026-09-20可当场跑

将 TypeSafe Jev 连接到 Grok Bot,作为廉价的决策层,支持使用门控、技能模板和示例。

英文原文

Connect TypeSafe Jev to Grok Bot as a cheap decision layer - usage gates, skill template, examples

Bodila51/grok-bot-jev

它在哪儿调用了 Jev

from typesafe_sdk import TypeSafeClient

src/jev_client.py:5

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

它问 Jev 的问题

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

取自 src/router.py:54

  1. intent选项

    What kind of work does this request mainly need?

    • chatShort answer or conversation; no tools needed
    • lookupKnown file/API/status check; mostly deterministic
    • researchNeed web/search and synthesis
    • browserNeed interactive browser clicks
    • codingEdit code / tests / repo work
    • writeDraft long prose/email/doc
    • accountSend, publish, pay, delete, change permissions
  2. reuse_cache是/否

    Is there already a fresh enough cached result that should be reused instead of doing new heavy work?

  3. needs_subagent是/否

    Does this clearly need an extra specialized bot (research/browser/coding) beyond one Grok Bot turn?

  4. stop_retry是/否

    Given prior_error and same_error_count, should we STOP retrying the same approach?

  5. complexity打分

    How much Grok Bot effort is justified?

    • 0Trivial — one step or cached
    • 1Normal — short tool use
    • 2Heavy — multi-step research/browser/coding

用你自己的内容跑一遍

代码
import { experimental_evaluate as evaluate } from 'ai';

const { answers } = await evaluate({
  model: 'typesafe-ai/jev',
  state,
  questions: {
    intent: { type: 'choice', instructions: 'What kind of work does this request mainly need?',
      criteria: { chat: 'Short answer or conversation; no tools needed', lookup: 'Known file/API/status check; mostly deterministic', research: 'Need web/search and synthesis', browser: 'Need interactive browser clicks', coding: 'Edit code / tests / repo work', write: 'Draft long prose/email/doc', account: 'Send, publish, pay, delete, change permissions' } },
    reuse_cache: { type: 'boolean', instructions: 'Is there already a fresh enough cached result that should be reused instead of doing new heavy work?' },
    needs_subagent: { type: 'boolean', instructions: 'Does this clearly need an extra specialized bot (research/browser/coding) beyond one Grok Bot turn?' },
    stop_retry: { type: 'boolean', instructions: 'Given prior_error and same_error_count, should we STOP retrying the same approach?' },
    complexity: { type: 'score', instructions: 'How much Grok Bot effort is justified?',
      criteria: ['Trivial — one step or cached', 'Normal — short tool use', 'Heavy — multi-step research/browser/coding'] },
  },
});

同类的其他项目