Skip to main content

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.2 and numba without 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.FlowsObserver
  • tuner_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tuner_pipecat_sdk-0.1.0.tar.gz (961.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuner_pipecat_sdk-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

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

Hashes for tuner_pipecat_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 52f0efdc058bac1a44c661f9ee9c02896daf57325a88e54e6631e80eab4792de
MD5 a9de0effe035612e7e0e71f94172ccf0
BLAKE2b-256 6aff7f02495343a939cb69b85962706375e5ab03f99645b449bc35a9ae313561

See more details on using hashes here.

File details

Details for the file tuner_pipecat_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tuner_pipecat_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 037ddb4566037ea6e04ea23201f4423bb5d3427b96b4a71bbcfd151db2679aa5
MD5 b72f2c42340180b84dc435e7c1e6d0ac
BLAKE2b-256 40b03f59fdf4517ef1fa1b1840b64de492bdd1b1b11e6ea240f35d09d16aeed9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page