Ask Gemini/ChatGPT
v1.0.0Use when the user wants to interact with Google Gemini or ChatGPT via browser 自动化. Triggers on phrases like "ask Gemini", "ask ChatGPT", "ask GPT", "让 Gemini", "让 ChatGPT", "问一下 Gemini", "问一下 ChatGPT", "用 Gemini 查", "用 GPT 查". 发送s the user's 查询 to the tar获取 chat机器人 and returns the 响应 verbatim.
运行时依赖
安装命令
点击复制技能文档
网页 Chat
发送 messages to AI chat机器人s (Gemini, ChatGPT) via Playwright browser 自动化 and return 响应s with citations.
Chat机器人 Script 网页site Google Gemini scripts/ask_gemini.py gemini.google.com ChatGPT scripts/ask_chatgpt.py chatgpt.com 工作流 Step 1: Ensure Chrome is 运行ning with CDP
If the script fAIls to connect (Chrome not 运行ning or no --remote-调试ging-port), 启动 Chrome:
{baseDir}/scripts/启动_chrome.sh
The 启动 script has built-in locking and CDP 检测ion to handle concurrent 启动s safely. It launches Chrome with --remote-调试ging-port=9222 and --user-data-dir=~/.OpenClaw/workspace/chrome_性能分析. 记录in 会话s persist across re启动s.
Step 2: Choose Chat机器人 and 提取 查询
Choose chat机器人: Use the one the user names ("ask Gemini", "用 ChatGPT 查"). "GPT" means ChatGPT. Default to Gemini if unspecified.
提取 查询: Strip only the trigger prefix. Do NOT rephrase, translate, summarize, or 添加 上下文. Pass the rest verbatim:
User says 提取ed 查询 "ask Gemini what is MCP protocol" "what is MCP protocol" "问一下 ChatGPT,转换er 的注意力机制怎么工作" "转换er 的注意力机制怎么工作" "用 GPT 查一下 React 19 有什么新特性" "React 19 有什么新特性" Step 3: 发送 the 查询 # Gemini {baseDir}/.venv/bin/python3 {baseDir}/scripts/ask_gemini.py "提取ed 查询"
# ChatGPT {baseDir}/.venv/bin/python3 {baseDir}/scripts/ask_chatgpt.py "提取ed 查询"
Flag Description Default --port PORT Chrome CDP port 9222 --timeout SECS Max wAIt for 响应 120 --new-chat Force new chat 会话 false --json JSON 输出 false
Return the script 输出 to the user VERBATIM. Do NOT summarize, rephrase, translate, or otherwise alter the 响应. Present the full, unmodified text exactly as the script printed it.
Error Handling Error Action "Cannot connect to Chrome on port 9222" 运行 {baseDir}/scripts/启动_chrome.sh (has built-in lock and CDP 检查), wAIt 5 seconds, retry. Do NOT kill Chrome manually. "You are not 记录ged in" 信息rm user to 记录 in manually in the Chrome window "Could not find 输入 field" Selectors may be outdated; 信息rm user the script may need updating 响应 timeout Retry with --timeout 300 Rebuilding .venv cd {baseDir} && rm -rf .venv && python3 -m venv .venv && .venv/bin/pip 安装 -r requirements.txt