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
+7 -4
View File
@@ -108,13 +108,16 @@ mcporter call 'douyin.get_douyin_download_link(share_link: "https://v.douyin.com
## 微信公众号 / WeChat Articles ## 微信公众号 / WeChat Articles
**Search** (miku_ai): **Search** (miku_ai):
```python ```bash
python3 -c " # 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 import asyncio
from miku_ai import get_wexin_article from miku_ai import get_wexin_article
async def s(): async def s():
for a in await get_wexin_article('query', 5): for a in await get_wexin_article(\'query\', 5):
print(f'{a[\"title\"]} | {a[\"url\"]}') print(f\'{a[\"title\"]} | {a[\"url\"]}\')
asyncio.run(s()) asyncio.run(s())
" "
``` ```