Skip to main content

Examples

This section contains examples demonstrating various features and use cases of Tyler.

Basic Examples

Advanced Examples

Each example includes complete code and explanations to help you understand and implement Tyler's features in your applications.

  1. Using Tools - Learn how to use and create custom tools
  2. Basic Streaming - Build real-time interactive applications
  3. Tools with Streaming - Combine tools with streaming responses
  4. Full Configuration - Explore all configuration options
  5. Database Storage - Set up persistent storage
  6. Interrupt Tools - Implement content moderation and control flow
  7. 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:

  1. Clone the repository:
git clone https://github.com/adamwdraper/tyler.git
cd tyler
  1. Install dependencies:
pip install tyler-agent[dev]
  1. Set up environment variables:
cp .env.example .env
# Edit .env with your API keys and configuration
  1. 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:

  1. Check the Configuration Guide
  2. Search GitHub Issues
  3. Ask in GitHub Discussions