web-llm-chat
by @godiao
Chat with web-based LLMs through the Chrome Relay extension. Supports Qwen (chat.qwen.ai) and Kimi (kimi.com) via scripts; more sites may be added. Use for w...
clawhub install web-llm-chat๐ About This Skill
name: web-llm-chat description: Chat with web-based LLMs through the Chrome Relay extension. Provides free access to powerful web search and RAG capabilities without API costs. Currently supports Qwen AI (chat.qwen.ai). Use for web search, deep research, multi-turn investigations, getting a second opinion, comparing AI responses, or delegating complex reasoning tasks. Requires Chrome extension relay connected with an LLM chat tab open. Triggers on phrases like "ask Qwen", "search with Qwen", "Qwen search", "deep research with Qwen", "Qwen research", "web LLM search", "browser AI chat", "free AI search", "Qwenๆไน่ฏด", "ๅป้ฎQwen", "Qwen ๆ็ดข", "Qwen ็ ็ฉถ", "็จ Qwen ๆทฑๅบฆ็ ็ฉถ".
Web LLM Chat Skill
Interact with web-based LLMs through the Chrome Relay extension. This skill enables automated conversations with AI models, supporting both simple queries and multi-turn research workflows.
Currently supported: Qwen AI (chat.qwen.ai) โ more models coming soon.
Why This Skill?
The Problem
The Opportunity
Modern web-based LLMs (like Qwen) offer:
The Solution
This skill leverages OpenClaw's Chrome Relay to:
Bottom line: Use OpenClaw to orchestrate powerful web-based LLMs at a fraction of the API cost, with better research quality than raw search APIs.
Features
Supported Models
| Model | Status | Notes | |-------|--------|-------| | Qwen AI (chat.qwen.ai) | โ Supported | Full support for search, RAG, and multi-turn conversations | | More models | ๐ง Coming soon | Open an issue to request support for other web-based LLMs |
Prerequisites
chat.qwen.ai/*)127.0.0.1:18789 (default)ws package installedInstallation
Install the ws package using your preferred package manager:
# npm
npm install wsyarn
yarn add wspnpm
pnpm add ws
Quick Start
Check Connection Status
node scripts/qwen_chat.js status
Send a Message
# Plain text (default)
node scripts/qwen_chat.js send "What is machine learning?"With custom wait time (for long responses)
node scripts/qwen_chat.js send "Explain RAG in detail" --wait 120Get response in Markdown format (preserves formatting)
node scripts/qwen_chat.js send "Write a Python function" --format markdownGet raw HTML
node scripts/qwen_chat.js send "Create a table" --format html
Read Current Page Content
node scripts/qwen_chat.js read
Command Reference
status
Check if Chrome Relay is connected and Qwen tab is active.
node scripts/qwen_chat.js status
Output:
Extension: โ
Connected
Qwen tab: โ
Qwen Chat
URL: https://chat.qwen.ai/c/...
send
Send a message to Qwen and receive the response.
node scripts/qwen_chat.js send "your message" [options]
Options:
| Option | Description | Default |
|--------|-------------|---------|
| --wait N | Maximum wait time in seconds | 45 |
| --format text\|markdown\|html | Output format | text |
| --debug-extract | Show extraction debugging info | off |
Output Formats:
text โ Plain text outputmarkdown โ Preserves code blocks, tables, lists, headers, and formattinghtml โ Raw HTML from the pageread
Read the current page content (useful for debugging or reviewing conversation history).
node scripts/qwen_chat.js read
research
Run multi-round research on a topic (fixed stages, consider using agent-orchestrated mode instead).
node scripts/qwen_chat.js research "AI safety" --rounds 10 --wait 120
How It Works
Response Extraction
The script uses a robust extraction strategy:
1. Send-ready detection: Waits until the page is ready for the next question (input field editable, send button enabled) 2. Anchor-based extraction: Uses the user's message as an anchor to find and extract only the latest response 3. Content stabilization: Waits for content to stabilize before extraction
Why Not Use Thinking Indicators?
Why Not Use Delta by Body Length?
bodyLen unpredictablyResearch Mode (Agent-Orchestrated)
For multi-turn research, use agent-orchestrated mode instead of the fixed research command. This allows the agent to dynamically control the conversation based on Qwen's responses.
Workflow
1. Determine research topic
2. Ask first question (open-ended, let Qwen expand)
3. Read Qwen's response
4. Analyze the response:
- Which point deserves deeper exploration?
- Which claim needs cross-validation?
- Any contradictions or gaps?
5. Ask follow-up question based on analysis
6. Repeat steps 3-5 for 5-10 rounds
7. Final round: Ask Qwen to summarize, agent also compiles its own summary
Example Per-Round Operation
# Agent sends question and waits for response
node scripts/qwen_chat.js send "What are the key challenges in RLHF?" --wait 120Agent can read full page if needed
node scripts/qwen_chat.js read
Follow-up Strategy
Good follow-ups come from Qwen's response:
| Response Pattern | Follow-up Direction | |-----------------|---------------------| | Mentions data/statistics | "What's the original source? Sample size?" | | Gives opinion without evidence | "Any research supporting this claim?" | | Mentions controversy | "What are the counter-arguments?" | | Uses "possibly/maybe" | "Under what conditions does this hold?" | | Lists multiple factors | "Which one is most critical? Why?" | | Mentions case study | "Has this case been challenged by other researchers?" | | Goes off-topic | "Back to the core question, specifically..." |
Best Practices
--wait 180 for search-heavy questions, --wait 60 for simple onesDebugging
Enable Extraction Debugging
node scripts/qwen_chat.js send "test message" --wait 90 --debug-extract
This shows:
Common Issues
| Issue | Solution |
|-------|----------|
| Extension disconnected | Check Chrome extension badge shows ON |
| No Qwen tab found | Open chat.qwen.ai and attach extension |
| Response not captured | Increase --wait time, use --debug-extract to diagnose |
| Markdown formatting broken | Code blocks use Monaco Editor; extraction handles this automatically |
Configuration
Auth Token
The script auto-derives the relay token from the OpenClaw config. Config priority:
1. E:\.openclaw\.openclaw\openclaw.json (Windows)
2. ~/.openclaw/.openclaw/openclaw.json (Unix)
Gateway Ports
1878918792 (Gateway + 3)Limitations
research command uses fixed stages โ use agent-orchestrated mode insteadFile Structure
qwen-chat/
โโโ SKILL.md # This file
โโโ scripts/
โ โโโ qwen_chat.js # Main script
โ โโโ _diagnose_selectors.js # Diagnostic tools
โ โโโ _analyze_format.js # Format analysis
โโโ references/
โโโ chrome-relay.md # Chrome Relay setup guide
See Also
License
See LICENSE file for details.
๐ก Examples
Check Connection Status
node scripts/qwen_chat.js status
Send a Message
# Plain text (default)
node scripts/qwen_chat.js send "What is machine learning?"With custom wait time (for long responses)
node scripts/qwen_chat.js send "Explain RAG in detail" --wait 120Get response in Markdown format (preserves formatting)
node scripts/qwen_chat.js send "Write a Python function" --format markdownGet raw HTML
node scripts/qwen_chat.js send "Create a table" --format html
Read Current Page Content
node scripts/qwen_chat.js read
โ๏ธ Configuration
Auth Token
The script auto-derives the relay token from the OpenClaw config. Config priority:
1. E:\.openclaw\.openclaw\openclaw.json (Windows)
2. ~/.openclaw/.openclaw/openclaw.json (Unix)
Gateway Ports
1878918792 (Gateway + 3)๐ Tips & Best Practices
--wait 180 for search-heavy questions, --wait 60 for simple ones