
    љi                         S SK r S SKJrJrJr  S SKJrJrJr  S SK	J
r
Jr  SSKJr  \ R                  " \5      r " S S\
5      r " S	 S
\
5      r " S S\
5      r " S S5      rg)    N)DictAnyOptional)	APIRouterHTTPExceptionstatus)	BaseModelField   )SpeechSynthesizerc                       \ rS rSr% Sr\" SSS9r\\   \	S'   \" SSS9r
\\\\4      \	S'   \" SS	S9r\\   \	S
'   \" SSS9r\\   \	S'    " S S5      rSrg)	TtsConfig
   z
TtsConfig is a data model that holds configuration settings for Text-to-Speech (TTS) components.

All fields are optional and default to None if not provided.
Nz2The voice speaker name or ID for speech synthesis.)defaultdescriptionspeakerz4A mapping of style keywords to speaker style values.style_mapperz5The timeout for speech synthesis requests in seconds.timeoutzPFlag indicating whether to enable debug mode. If True, detailed logs are output.debugc                       \ rS rSrSrSrg)TtsConfig.Config!   allow N)__name__
__module____qualname____firstlineno__extra__static_attributes__r       S/home/james-whalen/.local/lib/python3.13/site-packages/aiavatar/admin/config/tts.pyConfigr   !   s    r!   r#   r   )r   r   r   r   __doc__r
   r   r   str__annotations__r   r   r   floatr   boolr#   r    r   r!   r"   r   r   
   s    
 #HGXc]  .3J.L(4S>*   %K GXe_  "fE8D> 
 r!   r   c                   B    \ rS rSr% \" SS9r\\S'   \" SS9r\	\S'   Sr
g)	TtsConfigResponse%   zType of TTS componentr   typeConfiguration of TTS componentconfigr   N)r   r   r   r   r
   r-   r%   r&   r/   r   r    r   r!   r"   r*   r*   %   s,    +D#  4FI r!   r*   c                   ,    \ rS rSr% \" SS9r\\S'   Srg)UpdateTtsConfigRequest.   r.   r,   r/   r   N)	r   r   r   r   r
   r/   r   r&   r    r   r!   r"   r1   r1   .   s    4FI r!   r1   c                   (    \ rS rSrS\4S jrS rSrg)TtsConfigAPI4   ttsc                     Xl         g )Nr6   )selfr6   s     r"   __init__TtsConfigAPI.__init__5   s	     r!   c                    ^  [        5       nUR                  SS/SSSSS0SS0S	.S
9S[        4U 4S jj5       nUR                  SS/SSSSS0SS0SS0S.S
9S[        S[
        [        [        4   4U 4S jj5       nU$ )Nz/config/ttsr#   zGet TTS configurationzARetrieve the current configuration settings for the TTS componentzHCurrent TTS configuration including speaker, style, and timeout settingsr   z(Successfully retrieved TTS configurationzInternal server error)     )tagssummaryr   response_description	responsesreturnc            	        >#     TR                   n [        U R                  R                  [	        S0 U R                  5       D6S9$ ! [         a5  n[        R                  SU 35        [        [        R                  SS9eS nAff = f7f)N)r-   r/   z$Error retrieving TTS configuration: z8Internal server error while retrieving TTS configurationstatus_codedetailr   )r6   r*   	__class__r   r   
get_config	Exceptionloggererrorr   r   HTTP_500_INTERNAL_SERVER_ERROR)r6   exr9   s     r"   get_config_tts/TtsConfigAPI.get_router.<locals>.get_config_tts>   s~     hh(//$8s~~'78 
  CB4HI# & E EU s)   BA A B
B0B  BBzUpdate TTS configurationzZUpdate configuration settings for the TTS component. Only non-null values will be updated.z;Dictionary of successfully updated configuration parametersz&Successfully updated TTS configurationz Invalid configuration parameters)r=   i  r>   requestc                    >#     TR                   nUR                  U R                  R                  5       5      $ ! [         a5  n[
        R                  SU 35        [        [        R                  SS9eS nAff = f7f)Nz"Error updating TTS configuration: z6Internal server error while updating TTS configurationrE   )
r6   
set_configr/   
model_dumprJ   rK   rL   r   r   rM   )rQ   r6   rN   r9   s      r"   post_config_tts0TtsConfigAPI.get_router.<locals>.post_config_ttsY   sl     	hh~~gnn&?&?&ABB A"FG# & E ES s%   A<4: A<
A90A44A99A<)r   getr*   postr1   r   r%   r   )r9   routerrO   rU   s   `   r"   
get_routerTtsConfigAPI.get_router;   s    	+[!k#%OP#%<= 
 


	&7 	


	  
.t!^#%MN#%GH#%<= 
 


	+A 
	d3PS8n 
	


	 r!   r8   N)r   r   r   r   r   r:   rZ   r    r   r!   r"   r4   r4   4   s    6r!   r4   )loggingtypingr   r   r   fastapir   r   r   pydanticr	   r
   sts.ttsr   	getLoggerr   rK   r   r*   r1   r4   r   r!   r"   <module>rb      sX     & & 4 4 % (			8	$	 6	 Y = =r!   