Files
pipecat/examples/foundational
Paul Kompfner f3a4b416df Remove VisionImageRawFrame, which was previously being handled directly by the LLM services, and deprecate the associated VisionImageFrameAggregator.
Removing `VisionImageRawFrame` lets us simplify LLM services' logic, getting us closer to the idealized architecture where all they care about is handling context frames.

This change is in service of getting us closer to ready to deprecate usage of `OpenAILLMContext` and subclasses in favor of the universal `LLMContext`, at least for the traditional text-to-text LLMs.

Why remove `VisionImageRawFrame` rather than deprecate? It's "internal"—only created by `VisionImageFrameAggregator`—and never intended to be used directly by users (it would be difficult to use directly anyway).

Move the logic that was once in `VisionImageFrameAggregator` directly into the examples. Reasoning:
- If `UserImageRequester` is defined in the examples, it makes sense for `UserImageProcessor` to be too, as it’s the flip side of the same coin, so to speak
- The logic is now pretty trivial
- This kind of one-shot, history-less image-describing pipeline shouldn't be common at all; it's ok for it to live in examples rather than as a dedicated class
- In the short term, this enables us to create `LLMContext`s for services that support it and `OpenAILLMContext`s for services that don't yet (AWS)

This commit also adds missing translation from OpenAI-format image context messages to AWS format. Note that this isn't a wasted effort in the face of the upcoming migration to universal `LLMContext`—this work will be reused as it has to be implemented there too.
2025-09-08 17:00:08 -04:00
..
2025-09-02 17:31:39 -07:00
2025-09-02 17:31:39 -07:00
2025-09-02 17:31:39 -07:00
2025-09-02 17:31:39 -07:00
2025-09-02 17:31:39 -07:00
2025-09-02 17:31:39 -07:00

Pipecat Foundational Examples

This directory contains examples showing how to build voice and multimodal agents with Pipecat. Each example demonstrates specific features, progressing from basic to advanced concepts.

Setup

  1. Follow the README steps to get your local environment configured.

    Run from root directory: Make sure you are running the steps from the root directory.

    Using local audio?: The LocalAudioTransport requires a system dependency for portaudio. Install the dependency to use the transport.

  2. Copy the env.example file and add API keys for services you plan to use:

    cp env.example .env
    # Edit .env with your API keys
    
  3. Navigate to the examples directory if you aren't already there:

    cd examples/foundational
    
  4. Run any example:

    uv run python 01-say-one-thing.py
    
  5. Open the web interface at http://localhost:7860/client/ and click "Connect"

Running examples with other transports

Most examples support running with other transports, like Twilio or Daily.

Daily

You need to create a Daily account at https://dashboard.daily.co/u/signup. Once signed up, you can create your own room from the dashboard and set the environment variables DAILY_SAMPLE_ROOM_URL and DAILY_API_KEY. Alternatively, you can let the example create a room for you (still needs DAILY_API_KEY environment variable). Then, start any example with -t daily:

uv run 07-interruptible.py -t daily

Twilio

It is also possible to run the example through a Twilio phone number. You will need to setup a few things:

  1. Install and run ngrok.
ngrok http 7860
  1. Configure your Twilio phone number. One way is to setup a TwiML app and set the request URL to the ngrok URL from step (1). Then, set your phone number to use the new TwiML app.

Then, run the example with:

uv run 07-interruptible.py -t twilio -x NGROK_HOST_NAME

Examples by Feature

Basics

Conversational AI

Common Utilities

Advanced LLM Features

Media Handling

Vision & Multimodal

Voice & Language

Integration Examples

Performance & Optimization

Advanced Usage

Customizing Network Settings

uv run python <example-name> --host 0.0.0.0 --port 8080

Troubleshooting

  • No audio/video: Check browser permissions for microphone and camera
  • Connection errors: Verify API keys in .env file
  • Port conflicts: Use --port to change the port

For more examples, visit our the `pipecat-examples repository.