← 返回
AI智能

Ask Gemini/ChatGPT

Use when the user wants to interact with Google Gemini or ChatGPT via browser automation. Triggers on phrases like "ask Gemini", "ask ChatGPT", "ask GPT", "让...
Use when the user wants to interact with Google Gemini or ChatGPT via browser automation. Triggers on phrases like "ask Gemini", "ask ChatGPT", "ask GPT", "让...
ljie-pi
AI智能 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 532
下载
💾 23
安装
1
版本
#latest

概述

Web Chat

Send messages to AI chatbots (Gemini, ChatGPT) via Playwright browser automation and return responses with citations.

ChatbotScriptWebsite
--------------------------
Google Geminiscripts/ask_gemini.pygemini.google.com
ChatGPTscripts/ask_chatgpt.pychatgpt.com

Workflow

Step 1: Ensure Chrome is Running with CDP

If the script fails to connect (Chrome not running or no --remote-debugging-port), start Chrome:

{baseDir}/scripts/start_chrome.sh

The start script has built-in locking and CDP detection to handle concurrent starts safely. It launches Chrome with --remote-debugging-port=9222 and --user-data-dir=~/.openclaw/workspace/chrome_profile. Login sessions persist across restarts.

Step 2: Choose Chatbot and Extract Query

Choose chatbot: Use the one the user names ("ask Gemini", "用 ChatGPT 查"). "GPT" means ChatGPT. Default to Gemini if unspecified.

Extract query: Strip only the trigger prefix. Do NOT rephrase, translate, summarize, or add context. Pass the rest verbatim:

User saysExtracted query
---------------------------
"ask Gemini what is MCP protocol""what is MCP protocol"
"问一下 ChatGPT,transformer 的注意力机制怎么工作""transformer 的注意力机制怎么工作"
"用 GPT 查一下 React 19 有什么新特性""React 19 有什么新特性"

Step 3: Send the Query

# Gemini
{baseDir}/.venv/bin/python3 {baseDir}/scripts/ask_gemini.py "extracted query"

# ChatGPT
{baseDir}/.venv/bin/python3 {baseDir}/scripts/ask_chatgpt.py "extracted query"
FlagDescriptionDefault
----------------------------
--port PORTChrome CDP port9222
--timeout SECSMax wait for response120
--new-chatForce new chat sessionfalse
--jsonJSON outputfalse

Return the script output to the user VERBATIM. Do NOT summarize, rephrase, translate, or otherwise alter the response. Present the full, unmodified text exactly as the script printed it.

Error Handling

ErrorAction
---------------
"Cannot connect to Chrome on port 9222"Run {baseDir}/scripts/start_chrome.sh (has built-in lock and CDP check), wait 5 seconds, retry. Do NOT kill Chrome manually.
"You are not logged in"Inform user to log in manually in the Chrome window
"Could not find input field"Selectors may be outdated; inform user the script may need updating
Response timeoutRetry with --timeout 300

Rebuilding .venv

cd {baseDir} && rm -rf .venv && python3 -m venv .venv && .venv/bin/pip install -r requirements.txt

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 23:57 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,370
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 712 📥 243,832
ai-intelligence

Proactive Agent

halthelobster
将AI智能体从任务执行者升级为主动预判需求、持续优化的智能伙伴。集成WAL协议、工作缓冲区、自主定时任务及实战验证模式。Hal Stack核心组件 🦞
★ 836 📥 213,135