Documentation Index
Fetch the complete documentation index at: https://docs.usetuner.ai/llms.txt
Use this file to discover all available pages before exploring further.
This guide covers the Python SDK for pipecat-ai and pipecat-flows. The package is available on PyPI.
Video Tutorial
Prerequisites
- Tuner Active Account
- Configured Agent with provider “Custom API” in Tuner
- Python 3.10–3.13 (3.14 is not yet supported due to pipecat dependencies)
- Python project running pipecat-ai v0.0.105 or later
Overview
The tuner-pipecat-sdk is a lightweight observer that captures flow transitions, latency signals, transcript segments, and usage metadata from your Pipecat pipeline, then sends a structuredCallPayload to Tuner when the call ends — no manual API calls required.
The SDK ships two observer types depending on how your pipeline is structured:
| Observer | When to use |
|---|---|
Observer | Plain pipecat-ai pipelines using LLMContext directly |
FlowsObserver | Pipelines managed by pipecat-flows and a FlowManager |
Estimated time: 2 minutes from start to finish
Step 1: Install the SDK
For plain pipecat-ai pipelines:flows extra:
pipecat-ai>=0.0.105. Do not use Python 3.14 — pipecat dependencies (onnxruntime, numba) do not yet have 3.14 wheels.
Step 2: Set Your Credentials
You can configure credentials via environment variables or pass them directly in code.- Environment Variables
- Inline in Code
| Variable | Required | Description |
|---|---|---|
TUNER_API_KEY | ✅ | Bearer token (starts with tr_api_) |
TUNER_WORKSPACE_ID | ✅ | Your Tuner workspace ID |
TUNER_AGENT_ID | ✅ | Agent Remote identifier from Agent Settings |
TUNER_BASE_URL | — | API base URL (default: https://api.usetuner.ai) |
Step 3: Add the Observer
Choose the observer that matches your pipeline type.- Plain pipecat-ai
- pipecat-flows
Use
Observer when your pipeline manages context directly via LLMContext.enable_metrics and enable_usage_metrics, the observer will log warnings and LLM/TTS metric fields will be absent from the payload.
For more examples, see the tuner-pipecat-sdk-python examples.
Configuration Options
Call Type
Call Type
Override the default call type label:
Recording URL
Recording URL
Provide a recording URL if available. Default is
"pipecat://no-recording":Disconnection Reason
Disconnection Reason
Record why a call ended by passing a
Works the same way on both
disconnection_reason_resolver callable. The resolver is called at flush time and should return a string or None.Use the built-in constants from DisconnectReason:| Constant | Value |
|---|---|
DisconnectReason.USER_HANGUP | "user_hangup" |
DisconnectReason.AGENT_HANGUP | "agent_hangup" |
DisconnectReason.ERROR | "error" |
DisconnectReason.TIMEOUT | "timeout" |
DisconnectReason.UNKNOWN | "unknown" |
Observer and FlowsObserver.Model Names
Model Names
Specify your ASR, LLM, and TTS models for metadata:
Debug Mode
Debug Mode
Log the full transcript when flushing:
Full Examples
- Plain pipecat-ai
- pipecat-flows
Troubleshooting
No matching distribution found for onnxruntime
No matching distribution found for onnxruntime
Python 3.14: Pipecat pins
onnxruntime versions that have no 3.14 wheels. Switch to Python 3.12 or 3.13 and create a new venv.Failed to build numba / Cannot install on Python 3.14
Failed to build numba / Cannot install on Python 3.14
Same as above: use Python 3.12 or 3.13.
Calls don't appear in Tuner
Calls don't appear in Tuner
- Verify that
agent_idmatches the Agent Remote ID configured in Tuner under Agent Settings > Agent Connection. - Confirm
workspace_idis correct. - Ensure
enable_metrics=Trueandenable_usage_metrics=Trueare set onPipelineParams. - Check your application logs for any error messages from the observer.
Unauthorized (401)
Unauthorized (401)
What’s Next?
Configuring Your Agent
Set up call outcomes, user intents, and behavior checks.
Custom Integration
Learn about the underlying API if you need more control.
Classifying Calls
Define how Tuner categorizes your calls.
Real-Time Alerts
Get notified when issues are detected.