向AppAgent提供帮助文档
帮助文档为AppAgent
执行特定任务提供指导。 AppAgent
使用这些文档来理解任务的上下文和执行任务所需的步骤,从而有效地成为应用程序的专家。
如何向AppAgent提供帮助文档?
步骤1:准备帮助文档和元数据
UFO目前支持处理json
格式的帮助文档。未来将支持更多格式。
json
格式的帮助文档示例如下:
{
"application": "chrome",
"request": "How to change the username in chrome profiles?",
"guidance": [
"Click the profile icon in the upper-right corner of the Chrome window.",
"Click the gear icon labeled 'Manage Chrome Profiles' in the profile menu.",
"In the list of profiles, locate the profile whose name you want to change.",
"Hover over the desired profile and click the three-dot menu icon on that profile card.",
"Select 'Edit' from the dropdown menu.",
"In the Edit Profile dialog, click inside the name field.",
"Delete the current name and type your new desired username.",
"Click 'Save' to confirm the changes.",
"Verify that the profile name is updated in the profile list and in the top-right corner of Chrome."
]
}
将每个帮助文档保存在目标文件夹的json
文件中。
步骤2:将帮助文档放置在AppAgent目录中
准备好所有帮助文档及其元数据后,将它们放入一个文件夹中。允许帮助文档的子文件夹,但要确保每个帮助文档及其对应的元数据都放在同一个目录中。
步骤3:创建帮助文档索引器
将文档组织在一个名为path_of_the_docs
的文件夹中后,您可以创建一个离线索引器来支持UFO的RAG。请遵循以下步骤:
# Assume you are in the cloned UFO folder
python -m learner --app <app_name> --docs <path_of_the_docs>
- 将
<app_name>
替换为应用程序的确切进程名称,例如Microsoft Word的WINWORD.EXE
或PowerPoint的POWERPNT.EXE
。 - 将
<path_of_the_docs>
替换为包含所有文档的文件夹的完整路径。
此命令将使用Faiss和sentence transformer(即将支持其他嵌入)为path_of_the_docs
文件夹中的所有文档创建一个离线索引器。默认情况下,创建的索引将放置此处。
注意
确保准确定义app_name
,因为它用于在线RAG中匹配离线索引器。
如何使用帮助文档来增强AppAgent?
创建离线索引器后,您可以在从帮助文档中学习部分找到如何使用帮助文档来增强AppAgent
的指导。