Skip to content

docs: 增加agent编写教程 - #36

Open
Craun718 wants to merge 25 commits into
MaaXYZ:mainfrom
Craun718:docs/manual
Open

docs: 增加agent编写教程#36
Craun718 wants to merge 25 commits into
MaaXYZ:mainfrom
Craun718:docs/manual

Conversation

@Craun718

@Craun718 Craun718 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary by Sourcery

添加一份中文的 AgentServer 开发指南,并调整示例代理实现,以展示基础的自定义识别和动作用法。

New Features:

  • 引入中文 AgentServer 开发指南,涵盖环境搭建、自定义识别、自定义动作、注册、调试以及打包等内容。

Enhancements:

  • 更新示例自定义识别逻辑,使其对比多个区域的数字 OCR 结果,并返回最小值及其所在位置。
  • 扩展示例自定义动作,用于演示发送并等待一次点击操作。
  • 统一中文开发文档中警告块的格式。
Original summary in English

Summary by Sourcery

Add a Chinese AgentServer development guide and adjust demo agent implementations to showcase basic custom recognition and action usage.

New Features:

  • Introduce a Chinese AgentServer development guide covering setup, custom recognition, custom actions, registration, debugging, and packaging.

Enhancements:

  • Update the sample custom recognition to compare numeric OCR results across regions and return the smallest value and its location.
  • Extend the sample custom action to demonstrate posting and awaiting a click operation.
  • Normalize formatting for Chinese development documentation warning blocks.

文档:

  • 新增中文 AgentServer 开发指南,说明前置条件,并以 Python 作为示例实现语言。
  • 调整现有中文开发文档中的空行和提示块格式,使其更加统一一致。
Original summary in English

Summary by Sourcery

添加一份中文的 AgentServer 开发指南,并调整示例代理实现,以展示基础的自定义识别和动作用法。

New Features:

  • 引入中文 AgentServer 开发指南,涵盖环境搭建、自定义识别、自定义动作、注册、调试以及打包等内容。

Enhancements:

  • 更新示例自定义识别逻辑,使其对比多个区域的数字 OCR 结果,并返回最小值及其所在位置。
  • 扩展示例自定义动作,用于演示发送并等待一次点击操作。
  • 统一中文开发文档中警告块的格式。
Original summary in English

Summary by Sourcery

Add a Chinese AgentServer development guide and adjust demo agent implementations to showcase basic custom recognition and action usage.

New Features:

  • Introduce a Chinese AgentServer development guide covering setup, custom recognition, custom actions, registration, debugging, and packaging.

Enhancements:

  • Update the sample custom recognition to compare numeric OCR results across regions and return the smallest value and its location.
  • Extend the sample custom action to demonstrate posting and awaiting a click operation.
  • Normalize formatting for Chinese development documentation warning blocks.

@Craun718
Craun718 marked this pull request as ready for review July 3, 2026 02:34

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗨,我发现了 1 个问题,并留下了一些整体性的反馈:

  • my_reco.py 中,建议修复类名的拼写错误(MyRecongitionMyRecognition),以保持教程代码与术语一致,并避免让读者产生困惑;如有需要,请同时更新装饰器字符串和所有引用。
  • 在新的 agent.md 文档中,存在一些小的标点问题,例如 “请参考其他内容)” 中多余的右括号;清理这些细节会让教程读起来更加流畅。
AI Agents 的提示词
请根据以下代码审查意见进行修改:

## 整体评论
-`my_reco.py` 中,建议修复类名的拼写错误(`MyRecongition``MyRecognition`),以保持教程代码与术语一致,并避免让读者产生困惑;如有需要,请同时更新装饰器字符串和所有引用。
- 在新的 `agent.md` 文档中,存在一些小的标点问题,例如 “请参考[其他内容](#其他内容))” 中多余的右括号;清理这些细节会让教程读起来更加流畅。

## 逐条评论

### 评论 1
<location path="docs/zh_cn/develop/agent.md" line_range="176" />
<code_context>
+    ...
+```
+
+虽然没有在 `main.py` 中进行显示调用,但这里利用了 python 的特性,在导入时会自动执行 `my_action.py` 中的 `@AgentServer.custom_action` 装饰器,将 `MyCustomAction` 注册到 `AgentServer` 中。
+
+</details>
</code_context>
<issue_to_address>
**suggestion (typo):** 将『显示调用』改为更准确的『显式调用』,并统一 Python 大小写。

建议在这句话中将「显示调用」替换为「显式调用」,并把「python」改为「Python」,以与全文术语和大小写保持一致。

```suggestion
虽然没有在 `main.py` 中进行显式调用,但这里利用了 Python 的特性,在导入时会自动执行 `my_action.py` 中的 `@AgentServer.custom_action` 装饰器,将 `MyCustomAction` 注册到 `AgentServer` 中。
```
</issue_to_address>

Sourcery 对开源项目是免费的——如果你觉得我们的代码审查有帮助,欢迎分享 ✨
帮我变得更有用!请在每条评论上点击 👍 或 👎,我会根据你的反馈持续改进代码审查质量。
Original comment in English

Hey - I've found 1 issue, and left some high level feedback:

  • In my_reco.py, consider fixing the class name typo (MyRecongitionMyRecognition) to keep the tutorial code aligned with the terminology and avoid confusing readers, updating the decorator string and any references if needed.
  • In the new agent.md document, there are a couple of minor punctuation issues such as the extra closing parenthesis in “请参考其他内容)”; cleaning these up will make the tutorial read more smoothly.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In `my_reco.py`, consider fixing the class name typo (`MyRecongition``MyRecognition`) to keep the tutorial code aligned with the terminology and avoid confusing readers, updating the decorator string and any references if needed.
- In the new `agent.md` document, there are a couple of minor punctuation issues such as the extra closing parenthesis in “请参考[其他内容](#其他内容))”; cleaning these up will make the tutorial read more smoothly.

## Individual Comments

### Comment 1
<location path="docs/zh_cn/develop/agent.md" line_range="176" />
<code_context>
+    ...
+```
+
+虽然没有在 `main.py` 中进行显示调用,但这里利用了 python 的特性,在导入时会自动执行 `my_action.py` 中的 `@AgentServer.custom_action` 装饰器,将 `MyCustomAction` 注册到 `AgentServer` 中。
+
+</details>
</code_context>
<issue_to_address>
**suggestion (typo):** 将『显示调用』改为更准确的『显式调用』,并统一 Python 大小写。

建议在这句话中将「显示调用」替换为「显式调用」,并把「python」改为「Python」,以与全文术语和大小写保持一致。

```suggestion
虽然没有在 `main.py` 中进行显式调用,但这里利用了 Python 的特性,在导入时会自动执行 `my_action.py` 中的 `@AgentServer.custom_action` 装饰器,将 `MyCustomAction` 注册到 `AgentServer` 中。
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread docs/zh_cn/develop/agent.md Outdated
@Craun718

Copy link
Copy Markdown
Contributor Author

默佬批注:

  1. 给节点名和类名换成语义名称
  2. rois放外面顺便搞成传参教学
  3. github warning要顶格写
  4. readme的html注意缩进

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant