跳至内容

Pipeline Config

语音管道配置 dataclass

VoicePipeline的配置。

Source code in src/agents/voice/pipeline_config.py
@dataclass
class VoicePipelineConfig:
    """Configuration for a `VoicePipeline`."""

    model_provider: VoiceModelProvider = field(default_factory=OpenAIVoiceModelProvider)
    """The voice model provider to use for the pipeline. Defaults to OpenAI."""

    tracing_disabled: bool = False
    """Whether to disable tracing of the pipeline. Defaults to `False`."""

    trace_include_sensitive_data: bool = True
    """Whether to include sensitive data in traces. Defaults to `True`. This is specifically for the
      voice pipeline, and not for anything that goes on inside your Workflow."""

    trace_include_sensitive_audio_data: bool = True
    """Whether to include audio data in traces. Defaults to `True`."""

    workflow_name: str = "Voice Agent"
    """The name of the workflow to use for tracing. Defaults to `Voice Agent`."""

    group_id: str = field(default_factory=gen_group_id)
    """
    A grouping identifier to use for tracing, to link multiple traces from the same conversation
    or process. If not provided, we will create a random group ID.
    """

    trace_metadata: dict[str, Any] | None = None
    """
    An optional dictionary of additional metadata to include with the trace.
    """

    stt_settings: STTModelSettings = field(default_factory=STTModelSettings)
    """The settings to use for the STT model."""

    tts_settings: TTSModelSettings = field(default_factory=TTSModelSettings)
    """The settings to use for the TTS model."""

model_provider class-attribute instance-attribute

model_provider: VoiceModelProvider = field(
    default_factory=OpenAIVoiceModelProvider
)

语音模型提供者,用于管道处理。默认为OpenAI。

tracing_disabled class-attribute instance-attribute

tracing_disabled: bool = False

是否禁用管道的追踪功能。默认为 False

trace_include_sensitive_data class-attribute instance-attribute

trace_include_sensitive_data: bool = True

是否在跟踪中包含敏感数据。默认为True。这专门针对语音管道,而不是工作流内部发生的任何内容。

trace_include_sensitive_audio_data class-attribute instance-attribute

trace_include_sensitive_audio_data: bool = True

是否在跟踪中包含音频数据。默认为True

工作流名称 class-attribute instance-attribute

workflow_name: str = 'Voice Agent'

用于追踪的工作流名称。默认为Voice Agent

群组ID class-attribute instance-attribute

group_id: str = field(default_factory=gen_group_id)

用于追踪的分组标识符,可将同一对话或进程中的多个追踪记录关联起来。如未提供,系统将自动生成一个随机分组ID。

trace_metadata class-attribute instance-attribute

trace_metadata: dict[str, Any] | None = None

一个可选的字典,包含要随跟踪一起包含的额外元数据。

stt_settings class-attribute instance-attribute

stt_settings: STTModelSettings = field(
    default_factory=STTModelSettings
)

用于STT模型的设置。

文本转语音设置 class-attribute instance-attribute

tts_settings: TTSModelSettings = field(
    default_factory=TTSModelSettings
)

TTS模型使用的设置。