Examples
Small scripts demonstrating Pygent usage.
Core examples
- api_example.py — minimal
AgentAPI. - runtime_example.py — direct
Runtimeusage. - write_file_demo.py — built-in tools from Python.
- custom_model.py — basic custom model.
- custom_model_with_tool.py — custom model producing tool calls.
- custom_tool.py — custom tool registration.
- config_file_example.py — loading configuration from file.
- prompt_library.py — switching prompt builders.
Optional legacy examples
These demonstrate older multi-agent patterns that are no longer the default direction:
Run with:
python examples/<script>.py