Pipecat FrameProcessor that observes pipecat-flows calls and sends structured data to the Tuner API.
Project description
tuner-pipecat-sdk
tuner-pipecat-sdk is a lightweight observer SDK for pipecat-flows.
It captures flow transitions, latency signals, transcript segments, and usage metadata,
then sends a structured CallPayload to the Tuner API when a call ends.
Requirements
- Python 3.10–3.13.
- Do not use Python 3.14 for installs yet: Pipecat pulls
onnxruntime~=1.23.2andnumbawithout 3.14 wheels → errors like No matching distribution found for onnxruntime. - This SDK depends on
pipecat-ai>=0.0.105.
Installation
pip install tuner-pipecat-sdk
Quick Start Example
import uuid
from tuner_pipecat_sdk import FlowsObserver
observer = FlowsObserver(
api_key="YOUR_TUNER_API_KEY",
workspace_id=42,
agent_id="my-agent",
call_id=str(uuid.uuid4()),
base_url="https://app.usetuner.ai",
asr_model="deepgram/nova-3",
llm_model="gpt-4o-mini",
tts_model="cartesia/sonic",
)
# Required: attach the flow manager before running the pipeline
observer.attach_flow_manager(flow_manager)
observer.attach_turn_tracking_observer(turn_tracker)
Place the observer after TTS in your pipeline:
Pipeline([
transport.input(),
stt,
context_aggregator.user(),
llm,
tts,
observer,
transport.output(),
context_aggregator.assistant(),
])
Enable metrics on the pipeline task so latency and usage fields are populated:
from pipecat.pipeline.task import PipelineTask
from pipecat.pipeline.pipeline_params import PipelineParams
from pipecat.observers.turn_tracking_observer import TurnTrackingObserver
turn_tracker = TurnTrackingObserver()
task = PipelineTask(
pipeline,
params=PipelineParams(
observers=[observer.latency_observer, turn_tracker],
enable_metrics=True,
enable_usage_metrics=True,
),
)
Without these flags the observer will log warnings and LLM/TTS metric fields will be absent from the payload. For more example check https://github.com/usetuner/tuner-pipecat-sdk-python/tree/main/examples
FlowsObserver Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
api_key |
str |
— | Tuner API key |
workspace_id |
int |
— | Tuner workspace ID |
agent_id |
str |
— | Agent identifier |
call_id |
str |
— | Unique call ID (use uuid4()) |
base_url |
str |
http://localhost:8000 |
Tuner API base URL |
call_type |
str |
"web_call" |
Call type label |
recording_url |
str |
"pipecat://no-recording" |
Recording URL if available |
asr_model |
str |
"" |
ASR model name (e.g. deepgram/nova-3) |
llm_model |
str |
"" |
LLM model name (e.g. gpt-4o-mini) |
tts_model |
str |
"" |
TTS model name (e.g. cartesia/sonic) |
debug |
bool |
False |
Log full transcript at flush |
Public API
tuner_pipecat_sdk.FlowsObservertuner_pipecat_sdk.TunerConfig
Payload and transcript schemas are available under tuner_pipecat_sdk.models.
To build the project
folow the steps in setup_guide.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tuner_pipecat_sdk-0.1.0.tar.gz.
File metadata
- Download URL: tuner_pipecat_sdk-0.1.0.tar.gz
- Upload date:
- Size: 961.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52f0efdc058bac1a44c661f9ee9c02896daf57325a88e54e6631e80eab4792de
|
|
| MD5 |
a9de0effe035612e7e0e71f94172ccf0
|
|
| BLAKE2b-256 |
6aff7f02495343a939cb69b85962706375e5ab03f99645b449bc35a9ae313561
|
File details
Details for the file tuner_pipecat_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tuner_pipecat_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
037ddb4566037ea6e04ea23201f4423bb5d3427b96b4a71bbcfd151db2679aa5
|
|
| MD5 |
b72f2c42340180b84dc435e7c1e6d0ac
|
|
| BLAKE2b-256 |
40b03f59fdf4517ef1fa1b1840b64de492bdd1b1b11e6ea240f35d09d16aeed9
|