# PR Title feat: add simple_AutoGLM.py as a standalone core-logic demonstration #272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Title
feat: add simple_AutoGLM.py as a standalone core-logic demonstration
Description
📋 简介 (Description)
本 PR 贡献了一个名为
simple_AutoGLM.py的单文件脚本。该脚本旨在作为 Open-AutoGLM 的最小可行性示例(MVP),帮助开发者在不深入复杂代码库的情况下,快速理解 Agent 的底层运行原理。🎯 核心价值 (Key Values)
API_KEY和adb环境即可运行,极大降低了上手门槛。Handler、Builder、Runner等多个模块中的核心逻辑(如坐标转换、AST 指令解析、上下文图像清理)浓缩在一个文件内。✨ 核心机制复刻 (Core Mechanisms)
[0, 1000]相对坐标自动映射至手机真实物理像素。ADBKeyboard调用逻辑,解决了 ADB 原生input text不支持中文的问题。ast模块,确保从模型生成的<think>和<answer>标签中精准提取结构化动作指令。🚀 快速开始 (Quick Start)
pip install adbutils openai pillowsimple_AutoGLM.py中填入智谱 AI 的API_KEY。python simple_AutoGLM.py并根据提示输入任务描述。💡 维护者说明 (Notes for Maintainers)
该脚本放置在
examples/目录下(或项目根目录演示区),作为原工程化代码的“轻量版”补充。它不改变现有的包结构,主要用于社区交流、原理教学以及快速原型验证。Author: fanbozhou