- 稳定性
- 稳定
- 作用域
- 全局
- 边界
- packages/ai/agent-runtime
Agent 执行claude-sonnet-4-6
Ready- 用户提问查找最近欧区注册并通知团队
- 模型推理规划中 · 412 tokens
- tool_callsearch_users({ region: 'eu', since: '7d' })
- tool_result→ 23 条 · 184 ms
- tool_callsend_email({ to: 'team@', body: ... })
- tool_result→ ok · message_id=msg_8f2a
- 最终回复已发送欧区注册摘要给团队(23 条)。
步骤
7
Tokens
1,247
耗时
2.3s
工具调用
2
使用方式agent-runtime.ts
typescriptagent-runtime.ts
1import { AgentRuntime } from "@nebutra/agent-runtime";
2
3const runtime = new AgentRuntime({
4 model: "claude-sonnet-4-6",
5 durable: { store: "redis", ttl: "7d" },
6 hooks: {
7 onBeforeTool: ({ name, args }) => console.log("tool:", name),
8 onTurnComplete: ({ usage }) => meterUsage(usage),
9 },
10});
11
12const turn = await runtime.run({
13 prompt: "Refund the order placed yesterday",
14 tools: [refundTool, lookupOrderTool],
15 maxSteps: 8,
16});