
    љi+                         S SK r S SKJr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List)	APIRouterHTTPExceptionstatus)	BaseModelField   )STSPipelinec                      \ rS rSr% Sr\" SSS9r\\\	      \
S'   \" SSS9r\\   \
S'   \" SS	S9r\\   \
S
'   \" SSS9r\\	   \
S'   \" SSS9r\\   \
S'   \" SSS9r\\	   \
S'   \" SSS9r\\	   \
S'   \" SSS9r\\   \
S'   \" SSS9r\\   \
S'   \" SSS9r\\   \
S'   \" SSS9r\\   \
S'   \" SSS9r\\   \
S'    " S S5      rSrg) PipelineConfig
   z
PipelineConfig is a data model that holds configuration settings for the STS pipeline.

All fields are optional and default to None if not provided.
Nz-A list of wakewords to activate the pipeline.)defaultdescription	wakewordszFTimeout in seconds after which the pipeline requires a wakeword again.wakeword_timeoutz;Time threshold in seconds for merging consecutive requests.merge_request_thresholdz4Prefix text added when merging consecutive requests.merge_request_prefixzIInterval in seconds for inserting timestamps into requests. 0 to disable.timestamp_interval_secondsz$Prefix text for inserted timestamps.timestamp_prefixz<Timezone for inserted timestamps, e.g., 'UTC', 'Asia/Tokyo'.timestamp_timezonez2Flag indicating whether to enable voice recording.voice_recorder_enabledz4Idle timeout in seconds for the invoke queue worker.invoke_queue_idle_timeoutz1Timeout in seconds for a single invoke operation.invoke_timeoutzJFlag indicating whether to use the invoke queue for sequential processing.use_invoke_queuezPFlag indicating whether to enable debug mode. If True, detailed logs are output.debugc                       \ rS rSrSrSrg)PipelineConfig.ConfigA   allow N)__name__
__module____qualname____firstlineno__extra__static_attributes__r#       X/home/james-whalen/.local/lib/python3.13/site-packages/aiavatar/admin/config/pipeline.pyConfigr    A   s    r*   r,   r#   )r$   r%   r&   r'   __doc__r   r   r   r   str__annotations__r   floatr   r   r   r   r   r   boolr   r   r   r   r,   r)   r#   r*   r+   r   r   
   s{   
 &+C&IxS	"  ).\)huo  05Q0Xe_  +0J+(3-  38_3  ',:'hsm  ).R)  .3H.HTN  27J2x  ',G'NHUO  (-`(htn  "fE8D> 
 r*   r   c                   ,    \ rS rSr% \" SS9r\\S'   Srg)PipelineConfigResponseE   Configuration of STS pipeliner   configr#   N	r$   r%   r&   r'   r   r7   r   r/   r)   r#   r*   r+   r3   r3   E       "3FN r*   r3   c                   ,    \ rS rSr% \" SS9r\\S'   Srg)UpdatePipelineConfigRequestK   r5   r6   r7   r#   Nr8   r#   r*   r+   r;   r;   K   r9   r*   r;   c                   (    \ rS rSrS\4S jrS rSrg)PipelineConfigAPIQ   pipelinec                     Xl         g )Nr@   )selfr@   s     r+   __init__PipelineConfigAPI.__init__R   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/pipeliner,   zGet pipeline configurationz@Retrieve the current configuration settings for the STS pipelinezRCurrent pipeline configuration including wakewords, timestamps, and queue settingsr   z-Successfully retrieved pipeline configurationzInternal server error)     )tagssummaryr   response_description	responsesreturnc                     >#     TR                   n [        [        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)r7   z)Error retrieving pipeline configuration: z=Internal server error while retrieving pipeline configurationstatus_codedetailr#   )
r@   r3   r   
get_config	Exceptionloggererrorr   r	   HTTP_500_INTERNAL_SERVER_ERROR)r@   exrC   s     r+   get_config_pipeline9PipelineConfigAPI.get_router.<locals>.get_config_pipeline[   ss     ==-)BH,?,?,AB   HMN# & E EZ s$   A3+1 A3
A00A++A00A3zUpdate pipeline configurationzYUpdate configuration settings for the STS pipeline. Only non-null values will be updated.z;Dictionary of successfully updated configuration parametersz+Successfully updated pipeline configurationz Invalid configuration parameters)rG   i  rH   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 pipeline configuration: z;Internal server error while updating pipeline configurationrO   )
r@   
set_configr7   
model_dumprS   rT   rU   r   r	   rV   )rZ   r@   rW   rC   s      r+   post_config_pipeline:PipelineConfigAPI.get_router.<locals>.post_config_pipelineu   sn     	==**7>>+D+D+FGG FrdKL# & E EX s%   A<4: A<
A90A44A99A<)r   getr3   postr;   r   r.   r   )rC   routerrX   r^   s   `   r+   
get_routerPipelineConfigAPI.get_routerX   s    	0Z!u#%TU#%<= 
 


	+A 	


	 
3s!^#%RS#%GH#%<= 
 


	0K 
	PTUXZ]U]P^ 
	


	 r*   rB   N)r$   r%   r&   r'   r   rD   rc   r)   r#   r*   r+   r>   r>   Q   s    !!5r*   r>   )loggingtypingr   r   r   r   fastapir   r   r	   pydanticr
   r   sts.pipeliner   	getLoggerr$   rT   r   r3   r;   r>   r#   r*   r+   <module>rk      sY     , , 4 4 % '			8	$8Y 8vY ) < <r*   