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:
parent
afc8d0e3ee
commit
e6406500f3
1 changed files with 7 additions and 4 deletions
|
|
@ -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())
|
||||
"
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue