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.

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-0.1.3.tar.gz (30.2 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-0.1.3.tar.gz.

File metadata

File hashes

Hashes for openinference_instrumentation_pipecat-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5b371acba3badbc594b67845a81304531c03a9f355762f7bdad0bbead1b019f9
MD5 32dcd6dfe6c46bcf00abcf8789b28e65
BLAKE2b-256 1922df49d50f7f52fc5ae953fa0fb0f5dddd1b40a8a5c0c7b13b0e3dc1bd6b2a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openinference_instrumentation_pipecat-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 78fdf24f38ee0d03741f0b1be1768e6e30941ae0b8a38e1c12241df90388c522
MD5 7e7858f203f679eeac80718cae6e867a
BLAKE2b-256 d8a8d891260ff4646d319bf4698ea56a6ccae52007eb72ba8e16ec22d89ad564

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