Skip to content

Instantly share code, notes, and snippets.

@LiboShen
LiboShen / tiny_agent.py
Created April 3, 2025 18:28
A minimalist CLI AI agent with web browsing capabilities
"""
1. Make sure you have `uv` install. (e.g. `brew install uv`)
2. Setup Python venv `uv venv && source .venv/bin/activate`
3. Setup the model API key (e.g. `export ANTHROPIC_API_KEY=<your_api_key>`)
4. Run it! `uv run python tiny_agent.py`
"""
import asyncio
from pydantic_ai import Agent
@LiboShen
LiboShen / serve.sh
Created November 11, 2021 11:42
Web Server Bash Oneliner
# Need install netcat first
while true; do echo -ne "HTTP/1.0 200 OK\r\nContent-Length: 3\r\n\r\nok\n" | nc -l -p 8001; done