o
    ưi                     @   s   d dl mZmZmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ er?d dlmZ ddlmZ dd	lmZ eZeZeZneZeZeZG d
d deZdS )    )TYPE_CHECKINGAnyDictOptional) VideoCreateOptionalRequestParams)GenericLiteLLMParams)BaseAzureLLM)OpenAIVideoConfig)Logging   )BaseVideoConfig)BaseLLMExceptionc                       s   e Zd ZdZ fddZdedefddZdeded	e	de
fd
dZ		ddededee dee def
ddZdedee dedefddZ  ZS )AzureVideoConfigz:
    Configuration class for OpenAI video generation.
    c                    s   t    d S )N)super__init__)self	__class__ _/home/app/Keep/.python/lib/python3.10/site-packages/litellm/llms/azure/videos/transformation.pyr      s   zAzureVideoConfig.__init__modelreturnc                 C   s   g dS )zS
        Get the list of supported OpenAI parameters for video generation.
        )r   promptZinput_referencesecondssizeuserextra_headersr   )r   r   r   r   r   get_supported_openai_params   s   z,AzureVideoConfig.get_supported_openai_paramsvideo_create_optional_paramsdrop_paramsc                 C   s   t |S )z:No mapping applied since inputs are in OpenAI spec already)dict)r   r   r   r   r   r   r   map_openai_params,   s   z"AzureVideoConfig.map_openai_paramsNheadersapi_keylitellm_paramsc                 C   s,   |du rt  }|r|js||_tj||dS )z
        Validate Azure environment and set up authentication headers.
        Uses _base_validate_azure_environment to properly handle credentials from litellm_credential_name.
        N)r"   r$   )r   r#   r   Z _base_validate_azure_environment)r   r"   r   r#   r$   r   r   r   validate_environment5   s   
z%AzureVideoConfig.validate_environmentapi_basec                 C   s   t j||dddS )z@
        Constructs a complete URL for the API request.
        z/openai/v1/videos )r&   r$   ZrouteZdefault_api_version)r   Z_get_base_azure_url)r   r   r&   r$   r   r   r   get_complete_urlO   s   	z!AzureVideoConfig.get_complete_url)NN)__name__
__module____qualname____doc__r   strlistr   r   boolr   r!   r    r   r   r%   r(   __classcell__r   r   r   r   r      sF    

r   N)typingr   r   r   r   Zlitellm.types.videos.mainr   Zlitellm.types.routerr   Zlitellm.llms.azure.common_utilsr   Z)litellm.llms.openai.videos.transformationr	   Z*litellm.litellm_core_utils.litellm_loggingr
   Z_LiteLLMLoggingObjZbase_llm.videos.transformationr   Z_BaseVideoConfigZbase_llm.chat.transformationr   Z_BaseLLMExceptionZLiteLLMLoggingObjr   r   r   r   r   <module>   s     