Ë
    ÷¾™há
  ã                   ó^   — d dl mZmZ d dlZd dlZd dlmZ d dlmZ d dl	m
Z
  G d„ de«      Zy)é    )ÚOptionalÚcastN)ÚOpenAIImageEditConfig)Úget_secret_str)Ú_add_path_to_api_basec            	       óL   — e Zd Z	 d
dededee   defd„Zdedee   dedefd	„Zy)ÚAzureImageEditConfigNÚheadersÚmodelÚapi_keyÚreturnc                 ó²   — |xs< t         j                  xs* t         j                  xs t        d«      xs t        d«      }|j	                  dd|› i«       |S )NÚAZURE_OPENAI_API_KEYÚAZURE_API_KEYÚAuthorizationzBearer )Úlitellmr   Ú	azure_keyr   Úupdate)Úselfr
   r   r   s       úh/var/www/Befach/backend/env/lib/python3.12/site-packages/litellm/llms/azure/image_edit/transformation.pyÚvalidate_environmentz)AzureImageEditConfig.validate_environment   sk   € ð ò /Ü‰ò/ä× Ñ ò/ô Ð4Ó5ò/ô ˜oÓ.ð 	ð 	‰à 7¨7¨)Ð!4ðô	
ð
 ˆó    Úapi_baseÚlitellm_paramsc                 ó¬  — |xs t         j                  xs t        d«      }|€t        d|› d«      ‚t	        j
                  |«      }t        t        t           |j                  d«      «      }t        |j                  «      }d|vr|r||d<   d|vrt        |d|› d¬«      }n|}t	        j
                  |«      j                  |¬	«      }t        |«      S )
aƒ  
        Constructs a complete URL for the API request.

        Args:
        - api_base: Base URL, e.g.,
            "https://litellm8397336933.openai.azure.com"
            OR
            "https://litellm8397336933.openai.azure.com/openai/deployments/<deployment_name>/images/edits?api-version=2024-05-01-preview"
        - model: Model name (deployment name).
        - litellm_params: Additional query parameters, including "api_version".

        Returns:
        - A complete URL string, e.g.,
        "https://litellm8397336933.openai.azure.com/openai/deployments/<deployment_name>/images/edits?api-version=2024-05-01-preview"
        ÚAZURE_API_BASEz^api_base is required for Azure AI Studio. Please set the api_base parameter. Passed `api_base=ú`Úapi_versionzapi-versionz/openai/deployments/z/images/edits)r   Úending_path)Úparams)r   r   r   Ú
ValueErrorÚhttpxÚURLr   r   ÚstrÚgetÚdictr    r   Ú	copy_with)	r   r   r   r   Úoriginal_urlr   Úquery_paramsÚnew_urlÚ	final_urls	            r   Úget_complete_urlz%AzureImageEditConfig.get_complete_url!   sè   € ð* ÒSœw×/Ñ/ÒS´>ÐBRÓ3SˆØÐÜØpÐqyÐpzÐz{Ð|óð ô —y‘y Ó*ˆô œ8¤C™=¨.×*<Ñ*<¸]Ó*KÓLˆô ˜L×/Ñ/Ó0ˆð  Ñ,±Ø*5ˆL˜Ñ'ð "¨Ñ1Ü+Ø!Ø2°5°'¸ÐGô‰Gð
 ˆGô —I‘I˜gÓ&×0Ñ0¸Ð0ÓEˆ	ä9‹~Ðr   )N)Ú__name__Ú
__module__Ú__qualname__r&   r$   r   r   r,   © r   r   r	   r	      se   „ ð
 "&ñ	àðð ðð ˜#‘ð	ð
 
óð*2àð2ð ˜3‘-ð2ð ð	2ð
 
ô2r   r	   )Útypingr   r   r"   r   Ú-litellm.llms.openai.image_edit.transformationr   Úlitellm.secret_managers.mainr   Úlitellm.utilsr   r	   r0   r   r   ú<module>r5      s&   ðß !ã ã Ý OÝ 7Ý /ôHÐ0õ Hr   