Examples
This page collects small scripts demonstrating different aspects of Pygent. Each link points to the source file on GitHub.
- api_example.py – minimal use of the :class:
~pygent.agent.Agent
API. - runtime_example.py – using the :class:
~pygent.runtime.Runtime
class directly. - write_file_demo.py – calling the built-in tools from Python code.
- custom_model.py – implementing a simple custom model.
- custom_model_with_tool.py – custom model issuing tool calls.
- custom_tool.py – registering a custom tool.
- delegate_task_example.py – delegating work to a background agent.
- config_file_example.py – loading a config file and delegating a testing agent.
- delegate_external_tool.py – new tool using an external model service inside a delegated task.
See the Custom Models page for a walkthrough of building your own models.
See the Custom Models page for a walkthrough of building your own models.
Run these with python <script>
from the project root. They expect the environment variables described in the Configuration page.