Metadata-Version: 2.4
Name: page-eyes
Version: 0.2.3
Summary: PageEyes Agent 是一个轻量级 UI Agent，通过自然语言指令驱动，无需编写脚本既可实现Web、Android平台的UI自动化任务。
Project-URL: Homepage, https://github.com/tencentmusic/page-eyes-agent
Project-URL: Documentation, https://github.com/tencentmusic/page-eyes-agent
Project-URL: Repository, https://github.com/tencentmusic/page-eyes-agent
Project-URL: Changelog, https://github.com/tencentmusic/page-eyes-agent/blob/main/CHANGELOG.md
Author-email: aidenmo <aidenmo@tencent.com>
Maintainer-email: bepoxu <bepoxu@tencent.com>, leenjiang <leenjiang@tencent.com>, xinlanshi <xinlanshi@tencent.com>, yicanguo <yicanguo@tencent.com>, lancefayang <lancefayang@tencent.com>, aidenmo <aidenmo@tencent.com>
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.12
Requires-Dist: adbutils>=2.8.10
Requires-Dist: cos-python-sdk-v5>=1.9.38
Requires-Dist: esprima2>=5.0.0
Requires-Dist: loguru>=0.7.3
Requires-Dist: minio>=7.2.16
Requires-Dist: playwright>=1.52.0
Requires-Dist: pydantic-ai>=0.2.6
Description-Content-Type: text/markdown

## PageEyes Agent

![](https://img.shields.io/badge/build-passing-brightgreen)
![](https://img.shields.io/badge/python-12-blue?logo=python)

PageEyes Agent 是基于 [Pydantic AI](https://ai.pydantic.dev/#why-use-pydanticai) 框架开发的一个轻量级 UI Agent，
其中元素信息感知能力依靠 [OmniParserV2](https://huggingface.co/microsoft/OmniParser-v2.0) 模型，整个 Agent 的优势在于不依赖视觉语言大模型，
即使小参数的 LLM 也能胜任路径规划能力，同时支持多平台（Web、Android），目前主要包含以下功能：

1. 完全由自然语言指令驱动，无需编写脚本，既可实现自动化测试，UI巡检等任务
2. 跨平台、夸端支持，在 Python 环境中安装 page-eyes 库和配置 OmniParser 服务后即可开始 Web、Android 平台的自动化任务，未来还将继续支持iOS平台
3. 支持多种大模型接入，包括DeepSeek、OpenAI、千问等，默认使用 DeepSeek V3 模型，后续会支持更多大模型接入
4. 可通过自然语言进行断言，并生成详细的执行日志和报告，方便测试人员查看执行过程和结果

<img title="" src="https://cdn-y.tencentmusic.com/1e1e171e6dd06b6808489acd381db735.png" alt="" width="610" data-align="center">

***

## 安装

```shell
pip install page-eyes
```

## 使用示例

```python
import asyncio

from page_eyes.agent import WebAgent, MobileAgent


async def main():
    # Web 端
    ui_agent = await WebAgent.create(simulate_device='iPhone 15 Pro')

    # 移动端
    # ui_agent = await MobileAgent.create(serial='android-udid')

    report = await ui_agent.run(
        ('1.打开 url "https://yobang.tencentmusic.com/chart/uni-chart/rankList/"\n'
         '2.点击"查找icon"\n'
         '3.在搜索输入框中输入"小美满"\n'
         '4.点击"小美满> "\n'
         '5.点击"日榜"'
         ))


if __name__ == "__main__":
    asyncio.run(main())
```