Files
agent-fox/docs/project-management/module-management.md
2026-04-12 20:15:41 +08:00

46 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 模块管理
模块是 AgentFox 中端点的分组方式。导入 API 文档时,端点会自动按规则分组到不同模块中。
## 自动分组规则
导入 API 文档时AgentFox 按以下优先级自动创建模块:
1. **OpenAPI Tags**:如果端点定义了 `tags`,按 tag 名称分组
2. **路径前缀**:如果没有 tags按 URL 路径的第一段分组(如 `/users/...``users` 模块)
## 查看模块
在项目详情页的「模块」标签中,可以查看所有模块:
- 模块名称
- 模块中的端点数量
- 模块来源类型tag / path_prefix / manual
## 手动添加模块
1. 在「模块」标签页顶部,输入模块名称
2. 点击「添加」按钮
3. 新模块将显示在列表中(端点数量为 0
手动添加的模块可用于重新组织端点。
## 删除模块
1. 在模块列表中,找到要删除的模块
2. 点击删除按钮
3. 确认删除
> **注意**:删除模块会同时删除模块中的所有端点。此操作不可撤销。
## 模块对 MCP 工具的影响
模块直接影响 LLM 的查询体验:
- `get_project_overview` 返回所有模块的 ID 和端点数量
- `list_modules` 返回模块的详细描述
- `list_endpoints` 需要传入 `moduleId` 来查看特定模块的端点
- `search_endpoints` 可选传入 `moduleId` 来限定搜索范围
合理的模块划分有助于 LLM 更快定位到所需的端点。