PipelineParams
Configure pipeline execution with PipelineParams
Overview
The PipelineParams
class provides a structured way to configure various aspects of pipeline execution. These parameters control behaviors like audio settings, metrics collection, heartbeat monitoring, and interruption handling.
Basic Usage
Available Parameters
Whether to allow pipeline interruptions. When enabled, a user’s speech will immediately interrupt the bot’s response.
Input audio sample rate in Hz.
Setting the audio_in_sample_rate
as a PipelineParam
sets the input sample
rate for all corresponding services in the pipeline.
Output audio sample rate in Hz.
Setting the audio_out_sample_rate
as a PipelineParam
sets the output
sample rate for all corresponding services in the pipeline.
Whether to enable heartbeat monitoring to detect pipeline stalls. See Heartbeats for details.
Period between heartbeats in seconds (when heartbeats are enabled).
Whether to enable metrics collection for pipeline performance.
Whether to enable usage metrics tracking.
Whether to report only initial time to first byte metric.
Whether to send initial empty metrics frame at pipeline start.
Additional metadata to include in the StartFrame.
Common Configurations
Audio Processing Configuration
You can set the audio input and output sample rates in the PipelineParams
to set the sample rate for all input and output services in the pipeline. This acts as a convenience to avoid setting the sample rate for each service individually. Note, if services are set individually, they will supersede the values set in PipelineParams
.
Performance Monitoring Configuration
Pipeline heartbeats provide a way to monitor the health of your pipeline by sending periodic heartbeat frames through the system. When enabled, the pipeline will send heartbeat frames every second and monitor their progress through the pipeline.
How Parameters Are Used
The parameters you set in PipelineParams
are passed to various components of the pipeline:
- StartFrame: Many parameters are included in the StartFrame that initializes the pipeline
- Metrics Collection: Metrics settings configure what performance data is gathered
- Heartbeat Monitoring: Controls the pipeline’s health monitoring system
- Audio Processing: Sample rates affect how audio is processed throughout the pipeline
Complete Example
Additional Information
- Parameters are immutable once the pipeline starts
- The
start_metadata
dictionary can contain any serializable data - For metrics collection to work properly,
enable_metrics
must be set toTrue