o
    i{                     @   s   U d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	m
Z
 ed Zed ZeG d	d
 d
Zg dddgdgg dg dg dddgdZeeee f ed< G dd dZddddddddd d!d"
Zd#S )$u  
SERVICE METADATA REGISTRY - SOURCE OF TRUTH

⭐ THIS IS THE SOURCE OF TRUTH FOR ALL PIPECAT SERVICES ⭐

To add a new service:
  1. Add a ServiceDefinition to the appropriate list below
  2. Run: uv run scripts/imports/update_imports.py
  3. Run: uv run scripts/configs/update_configs.py

DO NOT edit _configs.py or _imports.py directly - they are auto-generated from this file.

This module contains:
  - ServiceDefinition dataclass
  - Service lists (WEBRTC_TRANSPORTS, STT_SERVICES, LLM_SERVICES, etc.)
  - FEATURE_DEFINITIONS dict
  - MANUAL_SERVICE_CONFIGS for complex initialization

For operations on services, use ServiceLoader from service_loader.py.
    )	dataclass)Literal   )SERVICE_CONFIGS)BASE_IMPORTSFEATURE_IMPORTSIMPORTS)	transportsttllmttsrealtime)web	telephonyc                   @   s   e Zd ZU dZeed< eed< eed< dZee dB ed< dZedB ed< dZ	ee dB ed< d	Z
eed
< d	Zeed< dZee dB ed< dd ZdS )ServiceDefinitiona  Service metadata definition.

    Required fields:
        value: Service identifier (e.g., "openai_llm")
        label: Human-readable name (e.g., "OpenAI")
        package: Python package requirement (e.g., "pipecat-ai[openai]")

    Optional fields:
        class_name: List of class names to import for this service
        env_prefix: Prefix for environment variables (e.g., "OPENAI" -> "OPENAI_API_KEY")
        include_params: Parameters to include in generated config even if they have defaults
        manual_config: If True, config must be manually written (not auto-generated)
        recommended: If True, this service is marked as recommended in prompts
        additional_imports: List of full import statements that can't be auto-discovered
    valuelabelpackageN
class_name
env_prefixinclude_paramsFmanual_configrecommendedadditional_importsc                 C   s.   | j std| jstd| jstddS )z1Validate service definition after initialization.zService must have a valuezService must have a labelzService must have a packageN)r   
ValueErrorr   r   )self r   Y/home/ubuntu/.local/lib/python3.10/site-packages/pipecat_cli/registry/service_metadata.py__post_init__C   s   zServiceDefinition.__post_init__)__name__
__module____qualname____doc__str__annotations__r   listr   r   r   boolr   r   r   r   r   r   r   r   '   s   
 r   )AudioBufferProcessordatetimeiowaveaiofilesAssistantTurnStoppedMessageUserTurnStoppedMessageSileroVADAnalyzer)PipelinePipelineRunnerPipelineParamsPipelineTask)
LLMContextLLMContextAggregatorPairLLMUserAggregatorParams)load_dotenvLLMRunFrameRunnerArgumentsBaseTransportWhiskerObserverTailObserver)	recordingtranscriptionvadpipelinecontextrunnerobservabilityFEATURE_DEFINITIONSc                !   @   s	  e Zd ZU dZeZeZeZeZeZe	dddg dde	ddd	g d
dgZ
ee	 ed< e	dddg dddgde	dddddgddgde	dddddgddgde	dddg dd gde	d!d"dddgddgde	d#d$dg d%dgde	d&d'dg d(dgde	d)d*dg d+dgdgZee	 ed,< e	d-d.d/d0gd1d2gd3e	d4d5d6d7gd8g d9d3e	d:d;d<d=gd>d2d?gd3e	d@dAdBdCgdDd2gd3e	dEdFdGdHgdId2gd3e	dJdKdGdLgdId2gd3e	dMdNdOdPgdQd2gd3e	dRdSdOdTgdQd2gd3e	dUdVdWdXgdYd2gd3e	dZd[d\d]gd^d2d?gd3e	d_d`dadbgdcdddegd3e	dfdgdhdigdjd2gd3e	dkdldmdngdod2gd3e	dpdqdrdsgdtd2gd3e	dudvdwdxgdvd2gd3e	dydzd{d|gd}d2gd3e	d~dd{dgd}d2gd3e	ddddgddd2gd3e	ddddgddd2gd3e	ddddgdd2gd3e	ddddgdd2gd3e	ddddgd}dgd3gZee	 ed< e	ddddgdd2dgd3e	ddd6dgd8ddgdde	ddd<dgdg dd3e	ddddgdd2dgd3e	ddddgdd2dgd3e	ddddgdd2dgd3e	dddadgdcd2dgd3e	dddadgdcg dd3e	ddddgdd2dgd3e	dddmdgdod2dgd3e	ddddgdd2dgd3e	ddvdwdgdvd2dgd3e	dddrdgddgd3e	ddd{dgd}d2dgd3e	ddddgdd2dgd3e	ddddgdd2dgd3e	ddddgdd2dgd3e	ddddgdd2dgd3e	ddddgdd2dgd3e	ddddgdd2dgd3gZee	 ed< e	ddddgdd2dgd3e	ddd6dgd8d?dgdde	ddd<d gd>g dd3e	ddddgdd2dgd3e	ddAdBdgdDd2dgd3e	d	dFdGd
gdId2dgd3e	ddNdOdgdQd2dgd3e	ddddgdd2dgd3e	dddadgdcdddgd3e	dddadgdcdddgd3e	dddhdgdjd2dgd3e	dddmdgdod2dgd3e	ddqdrd gdtd2dgd3e	d!d"d#d$gd%d2dgd3e	d&d'drd(gd)d2dgd3e	d*d+d,d-gd.dgd3e	d/d0d1d2gd0d2dgd3e	d3d4drd5gd6g d7d3e	d8d9d:d;gd<d2dgd3e	d=dvdwd>gdvd2dgd3e	d?d@d{dAgd}d2dgd3e	dBdCdDdEgdFdgd3e	dGdHdIdJgdKd2dgd3e	dLdMdNdOgdPd2dgd3e	dQddrdRgdg dSd3e	dTdUdVdWgdXddYgd3gZee	 edZ< e	d[d\d]d^gd8g dde	d_d`d<dagdbg ddcgdde	dedfdadggdcg dde	dhdidadjgdkg dde	dldmdÐdndogdg dde	dpdd{g dqd}g dde	drdsdtdudvgdwd2gddxgddgZee	 edy< e	dzd{d|d}gd~d2gddgdde	ddddgdd2dgd3e	ddddgdd2dgd3gZee	 ed< dS (  ServiceRegistrya  
    Central registry for all Pipecat services and their configurations.

    This class contains only DATA - service definitions, import mappings,
    and feature configurations. All logic for querying and working with
    services has been moved to ServiceLoader for better separation of concerns.

    For operations like:
    - Finding services: use ServiceLoader.get_service_by_value()
    - Getting imports: use ServiceLoader.get_imports_for_services()
    - Extracting extras: use ServiceLoader.extract_extras_for_services()
    dailyzDaily (WebRTC)zpipecat-ai[daily])DailyTransportDailyParamsDailyRunnerArguments)r   r   r   r   smallwebrtcSmallWebRTCzpipecat-ai[webrtc])SmallWebRTCTransportTransportParamsSmallWebRTCConnectionSmallWebRTCRunnerArgumentsWEBRTC_TRANSPORTStwilioTwiliozpipecat-ai[websocket])FastAPIWebsocketTransportFastAPIWebsocketParamsTwilioFrameSerializerWebSocketRunnerArgumentszimport aiohttpz:from pipecat.runner.utils import parse_telephony_websocket)r   r   r   r   r   twilio_daily_sip_dialinzTwilio + Daily SIP (Dial-in)rG   rF   z%from server_utils import AgentRequestzfrom twilio.rest import Clienttwilio_daily_sip_dialoutzTwilio + Daily SIP (Dial-out)z6from server_utils import AgentRequest, DialoutSettingsz from typing import Any, Optionaldaily_pstn_dialinzDaily PSTN (Dial-in))rG   DailyDialinSettingsrF   z3from pipecat.runner.types import DailyDialinRequestdaily_pstn_dialoutzDaily PSTN (Dial-out)telnyxTelnyx)rR   rS   TelnyxFrameSerializerrU   plivoPlivo)rR   rS   PlivoFrameSerializerrU   exotelExotel)rR   rS   ExotelFrameSerializerrU   TELEPHONY_TRANSPORTSassemblyai_stt
AssemblyAIzpipecat-ai[assemblyai]AssemblyAISTTService
ASSEMBLYAIapi_key)r   r   r   r   r   r   aws_transcribe_sttzAWS Transcribezpipecat-ai[aws]AWSTranscribeSTTServiceAWS)aws_access_key_idaws_session_tokenregion	azure_sttzAzure Speechzpipecat-ai[azure]AzureSTTServiceAZURE_SPEECHro   cartesia_sttCartesiazpipecat-ai[cartesia]CartesiaSTTServiceCARTESIAdeepgram_sttDeepgramzpipecat-ai[deepgram]DeepgramSTTServiceDEEPGRAMdeepgram_flux_sttzDeepgram FluxDeepgramFluxSTTServiceelevenlabs_stt
ElevenLabszpipecat-ai[elevenlabs]ElevenLabsSTTService
ELEVENLABSelevenlabs_realtime_sttzElevenLabs RealtimeElevenLabsRealtimeSTTServicefal_sttzFal (Wizper)zpipecat-ai[fal]FalSTTServiceFAL
gladia_sttGladiazpipecat-ai[gladia]GladiaSTTServiceGLADIA
google_sttzGoogle Speech-to-Textzpipecat-ai[google]GoogleSTTServiceGOOGLEcredentialslocationgradium_sttGradiumzpipecat-ai[gradium]GradiumSTTServiceGRADIUMgroq_sttzGroq (Whisper)zpipecat-ai[groq]GroqSTTServiceGROQhathora_sttHathoraz
pipecat-aiHathoraSTTServiceHATHORA
nvidia_sttNVIDIAzpipecat-ai[nvidia]NvidiaSTTService
openai_sttzOpenAI (Whisper)zpipecat-ai[openai]OpenAISTTServiceOPENAIopenai_realtime_sttzOpenAI RealtimeOpenAIRealtimeSTTServicesambanova_sttzSambaNova (Whisper)zpipecat-ai[sambanova]SambaNovaSTTService	SAMBANOVAmodel
sarvam_sttSarvamzpipecat-ai[sarvam]SarvamSTTServiceSARVAM
soniox_sttSonioxzpipecat-ai[soniox]SonioxSTTServiceSONIOXspeechmatics_sttSpeechmaticszpipecat-ai[speechmatics]SpeechmaticsSTTServiceSPEECHMATICSwhisper_sttzWhisper (Local)zpipecat-ai[whisper]WhisperSTTServiceSTT_SERVICESanthropic_llmzAnthropic Claudezpipecat-ai[anthropic]AnthropicLLMService	ANTHROPICaws_bedrock_llmzAWS BedrockAWSBedrockLLMService
aws_regionT)r   r   r   r   r   r   r   	azure_llmzAzure OpenAIAzureLLMServiceAZURE_CHATGPT)ri   endpointr   cerebras_llmCerebraszpipecat-ai[cerebras]CerebrasLLMServiceCEREBRASdeepseek_llmDeepSeekzpipecat-ai[deepseek]DeepSeekLLMServiceDEEPSEEKfireworks_llmzFireworks AIzpipecat-ai[fireworks]FireworksLLMService	FIREWORKSgoogle_gemini_llmzGoogle GeminiGoogleLLMServicegoogle_vertex_llmzGoogle Vertex AIGoogleVertexLLMService)r   r   
project_idgrok_llmGrokzpipecat-ai[grok]GrokLLMServiceGROKgroq_llmGroqGroqLLMServicemistral_llmMistralzpipecat-ai[mistral]MistralLLMServiceMISTRAL
nvidia_llmNvidiaLLMService
ollama_llmOllamaOLLamaLLMServiceOLLAMA
openai_llmOpenAIOpenAILLMServiceopenpipe_llmOpenPipezpipecat-ai[openpipe]OpenPipeLLMServiceOPENPIPEopenpipe_api_keyopenrouter_llm
OpenRouterzpipecat-ai[openrouter]OpenRouterLLMService
OPENROUTERperplexity_llm
Perplexityzpipecat-ai[perplexity]PerplexityLLMService
PERPLEXITYqwen_llmQwenzpipecat-ai[qwen]QwenLLMServiceQWENsambanova_llm	SambaNovaSambaNovaLLMServicetogether_llmzTogether AIzpipecat-ai[together]TogetherLLMServiceTOGETHERLLM_SERVICESasyncai_ttsAsynczpipecat-ai[asyncai]AsyncAITTSServiceASYNCAIvoice_idaws_polly_ttsz	AWS PollyAWSPollyTTSService	azure_ttsz	Azure TTSAzureTTSService)ri   ro   voicecamb_ttsCambzpipecat-ai[camb]CambTTSServiceCAMBcartesia_ttsCartesiaTTSServicedeepgram_ttsDeepgramTTSServicer  elevenlabs_ttsElevenLabsTTSServicefish_ttsFishzpipecat-ai[fish]FishAudioTTSServiceFISH
gemini_ttsz
Gemini TTSGeminiTTSService
google_ttsz
Google TTSGoogleTTSServicegradium_ttszGradium TTSGradiumTTSServicegroq_ttszGroq TTSGroqTTSServicehathora_ttsHathoraTTSServicehume_ttszHume TTSzpipecat-ai[hume]HumeTTSServiceHUMEinworld_ttsInworldInworldTTSServiceINWORLD
kokoro_ttsKokorozpipecat-ai[kokoro]KokoroTTSServiceKOKOROlmnt_ttsLMNTzpipecat-ai[lmnt]LmntTTSServiceminimax_ttsMiniMaxMiniMaxHttpTTSServiceMINIMAX)ri   group_idr   neuphonic_tts	Neuphoniczpipecat-ai[neuphonic]NeuphonicTTSService	NEUPHONIC
nvidia_ttsNvidiaTTSService
openai_ttsz
OpenAI TTSOpenAITTSService	piper_ttsPiperzpipecat-ai[piper]PiperTTSServicePIPERresemble_ttsResemblezpipecat-ai[resembleai]ResembleAITTSServiceRESEMBLErime_ttsRimezpipecat-ai[rime]RimeTTSServiceRIME
sarvam_ttsSarvamTTSService)ri   r   r   xtts_ttszXTTS (Coqui)zpipecat-ai[xtts]XTTSServiceXTTSbase_urlTTS_SERVICESaws_nova_realtimezAWS Nova Soniczpipecat-ai[aws-nova-sonic]AWSNovaSonicLLMServiceazure_realtimezAzure RealtimeAzureRealtimeLLMServiceAZUREz^from pipecat.services.openai.realtime.events import SessionProperties, InputAudioTranscription)r   r   r   r   r   r   r   r   gemini_live_realtimezGemini LiveGeminiLiveLLMServicegemini_vertex_live_realtimezGemini Vertex LiveGeminiLiveVertexLLMServiceGOOGLE_VERTEXgrok_realtimezGrok RealtimeGrokRealtimeLLMServiceSessionPropertiesopenai_realtime)OpenAIRealtimeLLMServicerW  AudioConfiguration
AudioInputInputAudioTranscriptionSemanticTurnDetectionInputAudioNoiseReductionultravoxUltravoxzpipecat-ai[ultravox]UltravoxRealtimeLLMServiceOneShotInputParamsULTRAVOXzimport datetimeREALTIME_SERVICESheygen_videoHeyGenzpipecat-ai[heygen]HeyGenVideoServiceHEYGENzHfrom pipecat.services.heygen.api import AvatarQuality, NewSessionRequesttavus_videoTavuszpipecat-ai[tavus]TavusVideoServiceTAVUS
replica_idsimli_videoSimlizpipecat-ai[simli]SimliVideoServiceSIMLIface_idVIDEO_SERVICESN)r   r    r!   r"   r   r   r   r   rC   r   rO   r%   r$   rd   r   r   rJ  rd  rs  r   r   r   r   rD   _   s  
 

	
e  6	  '	  W			
		
RrD   zAWSBedrockLLMService(
    aws_region=os.getenv("AWS_REGION"),
    model=os.getenv("AWS_BEDROCK_MODEL"),
    params=AWSBedrockLLMService.InputParams(temperature=0.8)
)zAWSPollyTTSService(
    region=os.getenv("AWS_REGION"),
    voice_id=os.getenv("AWS_VOICE_ID"),
    params=AWSPollyTTSService.InputParams(engine="generative"),
)at  session_properties = SessionProperties(
    input_audio_transcription=InputAudioTranscription(model="whisper-1"),
    instructions=os.getenv("AZURE_INSTRUCTIONS"),
)

llm = AzureRealtimeLLMService(
    api_key=os.getenv("AZURE_REALTIME_API_KEY"),
    base_url=os.getenv("AZURE_REALTIME_BASE_URL"),
    session_properties=session_properties,
    start_audio_paused=False,
)a  session_properties = SessionProperties(
    audio=AudioConfiguration(
        input=AudioInput(
            transcription=InputAudioTranscription(),
            turn_detection=SemanticTurnDetection(),
            noise_reduction=InputAudioNoiseReduction(type="near_field"),
        )
    ),
    instructions=os.getenv("OPENAI_INSTRUCTIONS"),
)

llm = OpenAIRealtimeLLMService(
    api_key=os.getenv("OPENAI_API_KEY"),
    session_properties=session_properties,
)zllm = GeminiLiveLLMService(
    api_key=os.getenv("GOOGLE_API_KEY"),
    model=os.getenv("GOOGLE_MODEL"),
    voice_id=os.getenv("GOOGLE_VOICE_ID"),
    system_instruction=os.getenv("GOOGLE_SYSTEM_INSTRUCTION"),
)a8  llm = GeminiLiveVertexLLMService(
        credentials=os.getenv("GOOGLE_APPLICATION_CREDENTIALS"),
        project_id=os.getenv("GOOGLE_PROJECT_ID"),
        location=os.getenv("GOOGLE_LOCATION"),
        voice_id=os.getenv("GOOGLE_VOICE_ID"),
        system_instruction=os.getenv("GOOGLE_SYSTEM_INSTRUCTION"),
)zsession_properties = SessionProperties(
    voice=os.getenv("GROK_VOICE_ID"),
    instructions=os.getenv("GROK_INSTRUCTIONS"),
)

llm = GrokRealtimeLLMService(
    api_key=os.getenv("GROK_API_KEY"),
    session_properties=session_properties,
)a	  llm = AWSNovaSonicLLMService(
    secret_access_key=os.getenv("AWS_SECRET_ACCESS_KEY"),
    access_key_id=os.getenv("AWS_ACCESS_KEY_ID"),
    region=os.getenv("AWS_REGION"),
    session_token=os.getenv("AWS_SESSION_TOKEN"),
    voice_id=os.getenv("AWS_VOICE_ID"),
)zHeyGenVideoService(
    api_key=os.getenv("HEYGEN_API_KEY"),
    session=session,
    session_request=NewSessionRequest(
        avatar_id="HEYGEN_AVATAR_ID", version="v2", quality=AvatarQuality.high
    ),
)zllm =UltravoxRealtimeLLMService(
    params=OneShotInputParams(
        api_key=os.getenv("ULTRAVOX_API_KEY"),
        system_prompt=os.getenv("ULTRAVOX_SYSTEM_PROMPT"),
        temperature=0.3,
        max_duration=datetime.timedelta(minutes=3),
    ),
))
r   r   rM  rX  rP  rR  rU  rK  re  r_  N)r"   dataclassesr   typingr   _configsr   _importsr   r   r   ServiceTypeBotTyper   rC   dictr#   r%   r$   rD   MANUAL_SERVICE_CONFIGSr   r   r   r   <module>   sF   (      =			
