
    Cj                     X    S SK JrJrJr  S SKrS SKJr  S SKJr  S SK	J
r
   " S S5      rg)    )AnyDictcastN)BaseVideoConfig) VideoCreateOptionalRequestParams)filter_out_litellm_paramsc            	       b    \ rS rSrSr\S\S\S\S\	4S j5       r
\S\	\\4   S\4S	 j5       rS
rg)VideoGenerationRequestUtils	   z7Helper utils for constructing video generation requestsmodel video_generation_provider_config video_generation_optional_paramsreturnc                     UR                  UU [        R                  S9nSU;   aD  US   nU(       a&  [        U[        5      (       a  UR                  U5        UR                  SS5        U$ )aU  
Get optional parameters for the video generation API.

Args:
    model: The model name
    video_generation_provider_config: The provider configuration for video generation API
    video_generation_optional_params: The optional parameters for video generation

Returns:
    A dictionary of supported parameters for the video generation API
)video_create_optional_paramsr   drop_params
extra_bodyN)map_openai_paramslitellmr   
isinstancedictupdatepop)r   r   r   mapped_paramsr   s        f/home/rurouni/.local/share/pipx/venvs/strix-agent/lib/python3.13/site-packages/litellm/videos/utils.py$get_optional_params_video_generation@VideoGenerationRequestUtils.get_optional_params_video_generation   sq    $ 9JJ)I++ K 
 ;;9,GJjT::$$Z0lD1    paramsc                    [        U =(       d    0 5      n U R                  S0 5      n[        U[         5      (       d  0 nUR                  SS5      nU R                  S5      nU R	                  5        VVs0 s H  u  pEUS;  d  M  Uc  M  XE_M     nnn[        US9n[        UR	                  5        VV	s0 s H  u  pU	c  M
  X_M     sn	nS9n
0 UEU
En0 nX24 H<  n[        U[         5      (       d  M  UR	                  5        H  u  pEUc  M
  X\U'   M     M>     U(       a%  [        US9nU(       a  XS'   UR                  U5        UR                  SS5        [        [        U5      $ s  snnf s  sn	nf )z
Filter parameters to only include those defined in VideoCreateOptionalRequestParams.

Args:
    params: Dictionary of parameters to filter

Returns:
    VideoCreateOptionalRequestParams instance with only the valid parameters
kwargsr   N>   r   r!   promptr   )r!   timeout)	r   getr   r   itemsr   r   r   r   )r   
raw_kwargskwargs_extra_bodytop_level_extra_bodykeyvaluebase_params_rawbase_paramskvcleaned_kwargsoptional_paramsmerged_extra_bodyextra_body_candidates                 r   -get_requested_video_generation_optional_paramIVideoGenerationRequestUtils.get_requested_video_generation_optional_param/   s    fl#ZZ"-
*d++J&NN<>%zz,7 %lln
,
EE   CJ, 	 
 0G2%/%5%5%7I%7TQ1DAD%7I
+
+
+

 -/%9$M .55"6"<"<">JC(16#. #? %N  9AR S 0A-&&'89It,4oFFA
 Js   4E%E%	E%3	E+
 E+
 N)__name__
__module____qualname____firstlineno____doc__staticmethodstrr   r   r   r   r   r3   __static_attributes__r5   r   r   r
   r
   	   sm    A  *9  +K  
	   D 5GS#X5G	)5G 5Gr   r
   )typingr   r   r   r   +litellm.llms.base_llm.videos.transformationr   litellm.types.videos.mainr   litellm.utilsr   r
   r5   r   r   <module>rB      s%    " "  G F 3\G \Gr   