Browse Snippets by Tags
Click on any tag to see all related snippets.
agents
OpenAI Agents SDK — basic agent and runner
Using the OpenAI Agents SDK to create agents with tools and run them with the basic Runner class.
ToyAIKit with OpenAI Agents SDK
Using ToyAIKit with the OpenAI Agents SDK to create persistent agents with tools and async chat interfaces.
ai
OpenAI Agents SDK — basic agent and runner
Using the OpenAI Agents SDK to create agents with tools and run them with the basic Runner class.
OpenAI Responses API — accessing function calls, messages, and usage
Examples showing how to call the Responses API, read function call outputs, inspect returned messages, and examine usage metadata.
Pydantic AI — streaming display with Rich
Display streaming agent execution using a Rich console while iterating over agent events.
ToyAIKit with Pydantic AI
Using ToyAIKit with Pydantic AI to create type-safe agents with structured tools and async chat interfaces.
ToyAIKit with OpenAI Agents SDK
Using ToyAIKit with the OpenAI Agents SDK to create persistent agents with tools and async chat interfaces.
ToyAIKit custom callbacks
Creating custom callback classes by extending RunnerCallback to handle function calls, messages, and responses in ToyAIKit runners.
ToyAIKit loops with callbacks and cost tracking
Using ToyAIKit callbacks to display intermediate results and track API costs in OpenAI Responses runner.
ToyAIKit — building AI assistants with tools
Using ToyAIKit to create AI assistants with custom tools and interactive chat interfaces.
anthropic
LLM API Cost Tracker
Track and calculate LLM API costs per model with JSONL logging and usage summaries.
api
OpenAI Responses API — accessing function calls, messages, and usage
Examples showing how to call the Responses API, read function call outputs, inspect returned messages, and examine usage metadata.
assistant
ToyAIKit — building AI assistants with tools
Using ToyAIKit to create AI assistants with custom tools and interactive chat interfaces.
async
OpenAI Agents SDK — basic agent and runner
Using the OpenAI Agents SDK to create agents with tools and run them with the basic Runner class.
ToyAIKit with Pydantic AI
Using ToyAIKit with Pydantic AI to create type-safe agents with structured tools and async chat interfaces.
ToyAIKit with OpenAI Agents SDK
Using ToyAIKit with the OpenAI Agents SDK to create persistent agents with tools and async chat interfaces.
asyncio
Async Message Batch Queue
Queue messages and send them in batches at regular intervals to avoid rate limits.
Async map with progress (tqdm) for asyncio
Run an async function over a sequence with concurrency limiting via asyncio.Semaphore while displaying a tqdm progress bar.
callbacks
ToyAIKit custom callbacks
Creating custom callback classes by extending RunnerCallback to handle function calls, messages, and responses in ToyAIKit runners.
ToyAIKit loops with callbacks and cost tracking
Using ToyAIKit callbacks to display intermediate results and track API costs in OpenAI Responses runner.
chat
ToyAIKit — building AI assistants with tools
Using ToyAIKit to create AI assistants with custom tools and interactive chat interfaces.
ci
Deploy Jekyll site to GitHub Pages (subfolder-aware)
A GitHub Actions workflow that builds a Jekyll site and deploys it to GitHub Pages, handling base paths for subfolder deployments.
concurrency
Async Message Batch Queue
Queue messages and send them in batches at regular intervals to avoid rate limits.
Async map with progress (tqdm) for asyncio
Run an async function over a sequence with concurrency limiting via asyncio.Semaphore while displaying a tqdm progress bar.
Map with progress (tqdm) for concurrent.futures
Run a function over a sequence using ThreadPoolExecutor while displaying a tqdm progress bar.
cost-tracking
LLM API Cost Tracker
Track and calculate LLM API costs per model with JSONL logging and usage summaries.
ToyAIKit loops with callbacks and cost tracking
Using ToyAIKit callbacks to display intermediate results and track API costs in OpenAI Responses runner.
dependencies
Adding editable file system dependencies with uv
How to add ediable local path dependencies and editable installations using uv package manager.
devops
Dockerfile for Python Service with UV
Production Dockerfile using UV for fast dependency installation and slim base image.
Python Project Makefile
Makefile with targets for testing, linting, formatting, Docker build, and integration tests.
docker
Dockerfile for Python Service with UV
Production Dockerfile using UV for fast dependency installation and slim base image.
function-calls
OpenAI Responses API — accessing function calls, messages, and usage
Examples showing how to call the Responses API, read function call outputs, inspect returned messages, and examine usage metadata.
github-actions
Deploy Jekyll site to GitHub Pages (subfolder-aware)
A GitHub Actions workflow that builds a Jekyll site and deploys it to GitHub Pages, handling base paths for subfolder deployments.
jekyll
Deploy Jekyll site to GitHub Pages (subfolder-aware)
A GitHub Actions workflow that builds a Jekyll site and deploys it to GitHub Pages, handling base paths for subfolder deployments.
llm
LLM API Cost Tracker
Track and calculate LLM API costs per model with JSONL logging and usage summaries.
makefile
Python Project Makefile
Makefile with targets for testing, linting, formatting, Docker build, and integration tests.
openai
LLM API Cost Tracker
Track and calculate LLM API costs per model with JSONL logging and usage summaries.
OpenAI Agents SDK — basic agent and runner
Using the OpenAI Agents SDK to create agents with tools and run them with the basic Runner class.
OpenAI Responses API — accessing function calls, messages, and usage
Examples showing how to call the Responses API, read function call outputs, inspect returned messages, and examine usage metadata.
packaging
Adding editable file system dependencies with uv
How to add ediable local path dependencies and editable installations using uv package manager.
pages
Deploy Jekyll site to GitHub Pages (subfolder-aware)
A GitHub Actions workflow that builds a Jekyll site and deploys it to GitHub Pages, handling base paths for subfolder deployments.
progress
Async map with progress (tqdm) for asyncio
Run an async function over a sequence with concurrency limiting via asyncio.Semaphore while displaying a tqdm progress bar.
Map with progress (tqdm) for concurrent.futures
Run a function over a sequence using ThreadPoolExecutor while displaying a tqdm progress bar.
pydantic
Pydantic AI — streaming display with Rich
Display streaming agent execution using a Rich console while iterating over agent events.
ToyAIKit with Pydantic AI
Using ToyAIKit with Pydantic AI to create type-safe agents with structured tools and async chat interfaces.
Pydantic Discriminated Unions
Use Literal type discriminators to model polymorphic block types with Pydantic.
python
Async Message Batch Queue
Queue messages and send them in batches at regular intervals to avoid rate limits.
Async map with progress (tqdm) for asyncio
Run an async function over a sequence with concurrency limiting via asyncio.Semaphore while displaying a tqdm progress bar.
Dockerfile for Python Service with UV
Production Dockerfile using UV for fast dependency installation and slim base image.
LLM API Cost Tracker
Track and calculate LLM API costs per model with JSONL logging and usage summaries.
Pydantic Discriminated Unions
Use Literal type discriminators to model polymorphic block types with Pydantic.
Python Project Makefile
Makefile with targets for testing, linting, formatting, Docker build, and integration tests.
Map with progress (tqdm) for concurrent.futures
Run a function over a sequence using ThreadPoolExecutor while displaying a tqdm progress bar.
Adding editable file system dependencies with uv
How to add ediable local path dependencies and editable installations using uv package manager.
rate-limiting
Async Message Batch Queue
Queue messages and send them in batches at regular intervals to avoid rate limits.
streaming
Pydantic AI — streaming display with Rich
Display streaming agent execution using a Rich console while iterating over agent events.
structured-output
Pydantic Discriminated Unions
Use Literal type discriminators to model polymorphic block types with Pydantic.
testing
Python Project Makefile
Makefile with targets for testing, linting, formatting, Docker build, and integration tests.
threading
Map with progress (tqdm) for concurrent.futures
Run a function over a sequence using ThreadPoolExecutor while displaying a tqdm progress bar.
tools
ToyAIKit with Pydantic AI
Using ToyAIKit with Pydantic AI to create type-safe agents with structured tools and async chat interfaces.
ToyAIKit with OpenAI Agents SDK
Using ToyAIKit with the OpenAI Agents SDK to create persistent agents with tools and async chat interfaces.
ToyAIKit — building AI assistants with tools
Using ToyAIKit to create AI assistants with custom tools and interactive chat interfaces.
toyaikit
ToyAIKit custom callbacks
Creating custom callback classes by extending RunnerCallback to handle function calls, messages, and responses in ToyAIKit runners.
ToyAIKit loops with callbacks and cost tracking
Using ToyAIKit callbacks to display intermediate results and track API costs in OpenAI Responses runner.
uv
Dockerfile for Python Service with UV
Production Dockerfile using UV for fast dependency installation and slim base image.
Adding editable file system dependencies with uv
How to add ediable local path dependencies and editable installations using uv package manager.