Examples
This section contains examples demonstrating various features and use cases of Tyler.
Basic Examples
- Using Tools - Learn how to use built-in and custom tools
- Basic Streaming - Build interactive applications with real-time streaming
- Tools with Streaming - Combine tools with streaming responses
- Message Attachments - Work with file attachments in messages
- Full Configuration - See all configuration options in action
Advanced Examples
- Database Storage - Store threads in SQLite or PostgreSQL
- File Storage - Store and process files with Tyler
- Interrupt Tools - Use tools that can interrupt the agent's processing
Each example includes complete code and explanations to help you understand and implement Tyler's features in your applications.
Quick Links
- Using Tools - Learn how to use and create custom tools
- Basic Streaming - Build real-time interactive applications
- Tools with Streaming - Combine tools with streaming responses
- Full Configuration - Explore all configuration options
- Database Storage - Set up persistent storage
- Interrupt Tools - Implement content moderation and control flow
- Message Attachments - Handle file attachments and processing
Running the Examples
All examples are available in the examples directory of the Tyler repository.
To run any example:
- Clone the repository:
git clone https://github.com/adamwdraper/tyler.git
cd tyler
- Install dependencies:
pip install tyler-agent[dev]
- Set up environment variables:
cp .env.example .env
# Edit .env with your API keys and configuration
- Run an example:
python examples/2-using_tools.py
Example Structure
Each example in this section includes:
- Complete source code
- Step-by-step explanation
- Key concepts covered
- Configuration requirements
- Expected output
Prerequisites
Before running the examples, ensure you have:
- Python 3.12.8 or later
- Required system libraries (libmagic, poppler)
- API keys for services used (OpenAI, etc.)
- Database setup (if using PostgreSQL examples)
Getting Help
If you encounter issues while running the examples:
- Check the Configuration Guide
- Search GitHub Issues
- Ask in GitHub Discussions