# 概览

Canonical URL: https://developers.iagenify.com/zh/sdk/ref/agent/
Language: zh

旧的代理,其循环在平台上运行,它存在于你没有运行的案例中——这就是工作流程步骤。

Status: no runtime option · 8 steps by default · tools are api.tools

`api.agents.create()` 无 `runtime` 构建此选项。 您给它提供模式会话、 存储和工具声明; 它会向后流, 而平台会执行它们 。

```javascript
const writer = await api.models.create({ model: "gemini-3.5-flash" });

const agent = api.agents.create({
  model: { main: writer },
  storages: [database],
  tools: { search: api.tools.search, query_storage: api.tools.queryStorage },
  maxSteps: 8,
  budget: 200,
});

const result = await agent.run({
  inputs: [{ type: "text", content: "Which customers churned last month?" }],
  onStep: (step) => console.log(step.tool, step.summary),
});
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `model` | object | 必填 | 示范会话或命名集: `{ main, image, video, voice, music }`. |
| `storages` | array | [] | [连接连接的系统](/zh/sdk/ref/connected-storage) 对象可以读取。 |
| `tools` | object | {} | [api.tools](/zh/sdk/ref/tools) 声明, 以模型所看到的名称为键。 |
| `outputs` | array | null | 跑步应该产生什么效果? |
| `maxSteps` | integer | 8 | 步骤。 |
| `budget` | integer|null | null | 信用 |

## 对抗当地引擎 {#versus}

|  | 当地当地 | 服务器侧侧 |
| --- | --- | --- |
| 循环循环运行 | 正在处理中 | 平台上的 |
| 工具工具工具工具 | 35,在你的机器上 | [api.tools](/zh/sdk/ref/tools) 声明 |
| 权限权限 | 您的回调, 依次调回 | 无,工具集是边界 |
| 届会、检查站、技能 | 否 是 | 无 无 |
| 默认步骤 | 100 | 8 |
| 需要你活着的过程 | 否 是 | 无 无 |

> **具有进程时优先使用本地引擎**
>
> 此处没有允许回调, 所以唯一的边界是您声明的工具和您通过过的存储工具。 这是用于一个无人看管的步骤的合理设计; 互动代理器的错误设计 。

## 仍然可以到达你的机器 {#local-bridge}

四个文件撰写声明和文件阅读器是通过包件、持有钥匙的机器上完成的:运行询问、您的程序完成工作、答案返回。所以只有在您的进程在监听时才起作用。

## 它保留自己的历史 {#history}

每一 `run()` 将交换器附加到 `agent.history`,下一个发送。 `history` 明确推翻,或 `[]` 开始新内容。

- [run()](/zh/sdk/ref/agent/run): 呼唤和它的流水
- [api.tools](/zh/sdk/ref/tools): 需要声明
- [agent.run](/zh/sdk/workflows/steps/agent-run): 工作流程步骤就是以此为基础。

```python
writer = api.models.create(model="gemini-3.5-flash")

agent = api.agents.create(
    model={"main": writer},
    storages=[database],
    tools={"search": api.tools.search, "query_storage": api.tools.query_storage},
    max_steps=8,
    budget=200,
)

result = agent.run(
    inputs=[{"type": "text", "content": "Which customers churned last month?"}],
    on_step=lambda step: print(step.get("tool"), step.get("summary")),
)
```
