Agent 工具
将 TypeSafe Jev 连接到 Grok Bot,作为廉价的决策层,支持使用门控、技能模板和示例。
Connect TypeSafe Jev to Grok Bot as a cheap decision layer - usage gates, skill template, examples
from typesafe_sdk import TypeSafeClient链接指向我们抓取当天的那个 commit,行号是准的。
下面是从这个项目源码里原样取出来的 question 组合。
intent选项What kind of work does this request mainly need?
chat — Short answer or conversation; no tools neededlookup — Known file/API/status check; mostly deterministicresearch — Need web/search and synthesisbrowser — Need interactive browser clickscoding — Edit code / tests / repo workwrite — Draft long prose/email/docaccount — Send, publish, pay, delete, change permissionsreuse_cache是/否Is there already a fresh enough cached result that should be reused instead of doing new heavy work?
needs_subagent是/否Does this clearly need an extra specialized bot (research/browser/coding) beyond one Grok Bot turn?
stop_retry是/否Given prior_error and same_error_count, should we STOP retrying the same approach?
complexity打分How much Grok Bot effort is justified?
0 — Trivial — one step or cached1 — Normal — short tool use2 — Heavy — multi-step research/browser/codingimport { 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'] },
},
});