> ## Documentation Index
> Fetch the complete documentation index at: https://phaseo.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# API 参考

> 查阅 Go Agent SDK 的主要类型和方法。

| API | 用途 |
| - | - |
| `CreateAgent(...)` | 定义 Agent |
| `DefineTool(...)` | 定义本地或手动工具 |
| `CreateGatewayAgentClient(...)` | 将模型轮次连接到 Phaseo |
| `Agent.Run(...)` | 运行至结束或暂停状态 |
| `Agent.Stream(...)` | 运行并提供可重放流消费者 |
| `Agent.Continue(...)` | 继续已保存或暂停的状态 |
| `StreamResult.Result()` | 读取已完成的运行结果 |
| `StreamResult.Text()` | 读取文本增量 |
| `StreamResult.Events()` | 读取所有事件 |
| `StreamResult.Cancel()` | 取消当前运行 |

重要类型包括 `AgentDefinition`、`RunOptions`、`RunResult`、`RunRecord`、`RunStep`、`Tool`、`ToolDecision`、`ToolOutput`、`RuntimeContext`、`StateAccessor`、`ModelRetryConfig` 和 `ToolExecutionConfig`。

## 相关内容

* [构建你的第一个 Agent](./agent-sdk.mdx)
* [可观测性与 DevTools](./agent-sdk-observability.mdx)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.