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

# 生成示例代码

> 让 Agent 根据文档自动生成可用的 Docflow API 调用代码

## 01 场景说明

安装 Docflow 文档 Skill 后，Agent 可以根据 API 文档自动生成规范的调用代码，包含参数处理、错误处理等完整逻辑。

## 02 示例

### 2.1 生成文档抽取调用代码

```text theme={null}
帮我生成一个调用 Docflow 文档抽取 API 的 Python 代码
```

<img src="https://mintcdn.com/docflow/Jdb0x48l-7Fd9FGi/docflow/cn/images/example-generate-code.png?fit=max&auto=format&n=Jdb0x48l-7Fd9FGi&q=85&s=0f8810f86395834453c86e96d14a6ac4" alt="生成示例代码" width="789" height="938" data-path="docflow/cn/images/example-generate-code.png" />

<Tip>
  Agent 生成的代码会自动引用最新的 API 文档，确保参数名称和接口地址是准确的。
</Tip>
