docs(wechat): use agent-reach interpreter for miku_ai search example (#188)

miku_ai is installed inside the agent-reach Python environment (pipx venv
or user venv). Using bare 'python3' fails when agent-reach was installed
via pipx, because system python3 cannot import miku_ai.

Fix: detect the correct interpreter at runtime via:
  $(python3 -c "import agent_reach, sys; print(sys.executable)")

This resolves the interpreter transparently for pipx, venv, and plain pip
installs without hardcoding paths.

Closes #187

Co-authored-by: Panniantong <panniantong@users.noreply.github.com>
This commit is contained in:
Pnant 2026-03-23 18:32:40 +08:00 committed by GitHub
parent afc8d0e3ee
commit e6406500f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -108,13 +108,16 @@ mcporter call 'douyin.get_douyin_download_link(share_link: "https://v.douyin.com
## 微信公众号 / WeChat Articles
**Search** (miku_ai):
```python
python3 -c "
```bash
# miku_ai is installed inside the agent-reach Python environment.
# Use the same interpreter that runs agent-reach (handles pipx / venv installs):
AGENT_REACH_PYTHON=$(python3 -c "import agent_reach, sys; print(sys.executable)" 2>/dev/null || echo python3)
$AGENT_REACH_PYTHON -c "
import asyncio
from miku_ai import get_wexin_article
async def s():
for a in await get_wexin_article('query', 5):
print(f'{a[\"title\"]} | {a[\"url\"]}')
for a in await get_wexin_article(\'query\', 5):
print(f\'{a[\"title\"]} | {a[\"url\"]}\')
asyncio.run(s())
"
```