Skip to main content

OpenInference Pipecat Instrumentation

Project description

OpenInference Pipecat Instrumentation

Python auto-instrumentation library for Pipecat. This library allows you to convert Pipecat traces to OpenInference, which is OpenTelemetry compatible, and view those traces in Arize Phoenix.

Compatibility

openinference-instrumentation-pipecat pipecat-ai Python
>=1.0 >=1.0 >=3.11
<=0.1.4 <1.0 (e.g. 0.0.99) >=3.10

Pipecat 1.0 introduced breaking changes (renamed observers, removed LLMMessagesFrame, dropped Python 3.10). If you're still on pipecat-ai<1.0, pin this instrumentor to <=0.1.4:

pip install 'openinference-instrumentation-pipecat<=0.1.4' 'pipecat-ai<1.0'

Installation

pip install openinference-instrumentation-pipecat

Quickstart

This quickstart shows you how to setup tracing in your Pipecat application:

from phoenix.otel import register
from openinference.instrumentation.pipecat import PipecatInstrumentor

# Set up the tracer provider
tracer_provider = register(
    project_name="default" #Phoenix project name
)

# Add auto-instrumentor at the top of the application
PipecatInstrumentor().instrument(tracer_provider=tracer_provider)

# Build your Pipecat pipeline
# ... (add your Pipecat pipeline code here)

### CONFIGURATION SETUP (Transport, LLM, STT, TTS) ###

### PIPELINE ###
pipeline = Pipeline(...)

### TASK ###
task = PipelineTask(
    pipeline,
    conversation_id=conversation_id,  # conversation id is used for session tracking in Arize or Phoenix
)

### EVENT HANDLING
@transport.event_handler("on_client_connected")
async def on_client_connected(transport, client):
    await task.queue_frames([LLMRunFrame()])

### PIPELINE RUNNER ###
runner = PipelineRunner(handle_sigint=runner_args.handle_sigint)
await runner.run(task)

After configuring tracing, exchanges in the running application are logged to your project in Phoenix or Arize AX.

Example

  1. Install dependencies
uv pip install -e '.[examples]'

or

uv pip install -r examples/trace/requirements.txt
  1. Run example
uv run python examples/trace/001-trace.py

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

openinference_instrumentation_pipecat-1.0.4.tar.gz (32.6 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file openinference_instrumentation_pipecat-1.0.4.tar.gz.

File metadata

File hashes

Hashes for openinference_instrumentation_pipecat-1.0.4.tar.gz
Algorithm Hash digest
SHA256 ca2af4c68ea2ef05c87abf9c91a6cfd076328fcfcaea0ecdb135c62aaad89ab1
MD5 bfd6d564f47aa809a81aeb681d903c3d
BLAKE2b-256 42a706edc09cab8a2ec5274cfb69d1f5a3432918e741401f18cceddbb22037d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for openinference_instrumentation_pipecat-1.0.4.tar.gz:

Publisher: publish.yaml on Arize-ai/openinference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openinference_instrumentation_pipecat-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for openinference_instrumentation_pipecat-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9770eadf06ce4b02ad42ec3c9ed70d9f3abd4cd9639b95eb7e7273c98678afc0
MD5 c1f78ecc4d4856f04a2c72053ed0e7c8
BLAKE2b-256 a024a0763ac34afda74bd6d021555fbb33288f175ccda9847640c034c71ecda1

See more details on using hashes here.

Provenance

The following attestation bundles were made for openinference_instrumentation_pipecat-1.0.4-py3-none-any.whl:

Publisher: publish.yaml on Arize-ai/openinference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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