2.0 KiB
Raw Blame History

id, title, type, feature, scope, locale, aliases, related_tools, related_pages, prerequisites, negative, last_verified
id title type feature scope locale aliases related_tools related_pages prerequisites negative last_verified
ai-assistant.match-elements.concept AI 怎么找到页面元素 concept ai-assistant end-user zh
match_elements
AI 找按钮
元素匹配
向量匹配元素
AI 怎么知道点哪
AI 元素识别
应用市场已安装 ai 插件
匹配纯依赖元素可见文本/aria-label/title无文本的图标按钮命中率低
单次匹配上限 50 个候选元素
不持久化匹配结果,每轮交互需重新取上下文
v1.7.90

AI 怎么找到页面元素

定义

当 AI 想操作页面元素(点按钮、填表)时,先调 get_page_context 拿到候选元素列表(每条含 ref / name / role再通过后端 API POST api/assistant/match-elements 把"用户意图描述"和"候选列表"提交给 embedding 服务,返回按余弦相似度排序的命中元素。

工作流

  1. 采集:前端按 ARIA 角色扫描,给每个可交互元素分配 refe1, e2...)和 name
  2. 关键词过滤:先用 query 做子串匹配
  3. 向量匹配:关键词没命中时对 query 和元素 name 求 embedding取相似度 top-K默认 10最多 50
  4. 执行:模型拿匹配元素的 ref 调 execute_element_action

元素信息字段

  • ref本轮唯一标识e1, e2...
  • name:可见文本 / aria-label / title
  • roleARIA 角色button / textbox / link 等)
  • selector + nth:兜底选择器

命中率

  • 有清晰文本的按钮:高
  • 仅 icon 无 aria-label建议加 title
  • 隐藏元素:默认不采集

不支持

  • 不支持图像 OCR 识图(仅基于文本)
  • 不支持「按位置」找元素("左上角第三个"
  • 不能跨 iframe 匹配

相关