
    ^h                     N    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\5      r	g)    )OptionalTupleUnionN)OpenAIGPTConfigget_secret_strc                     ^  \ rS rSr% SrSr\\   \S'   Sr	\\
\\4      \S'   Sr\\   \S'   Sr\\   \S'   Sr\\   \S'   Sr\\   \S	'   Sr\\   \S
'   Sr\\
\\4      \S'   Sr\\   \S'   Sr\\   \S'   Sr\\   \S'   Sr\\   \S'   Sr\\
\\4      \S'                SS\\   S\\
\\4      S\\   S\\   S\\   S	\\   S
\\   S\\
\\4      S\\   S\\   S\\   S\\   S\\
\\4      SS4S jjr\U 4S j5       rS\4S jrS\S\S\S\S\4
S jrS\\   S\\   S\\\   \\   4   4S jr Sr!U =r"$ )DeepInfraConfig   z
Reference: https://deepinfra.com/docs/advanced/openai_api

The class `DeepInfra` provides configuration for the DeepInfra's Chat Completions API interface. Below are the parameters:
Nfrequency_penaltyfunction_call	functions
logit_bias
max_tokensnpresence_penaltystoptemperaturetop_presponse_formattoolstool_choicereturnc                     [        5       R                  5       nUR                  5        H*  u  nnUS:w  d  M  Uc  M  [        U R                  UU5        M,     g )Nself)localscopyitemssetattr	__class__)r   r   r   r   r   r   r   r   r   r   r   r   r   r   locals_keyvalues                    d/home/james-whalen/.local/lib/python3.13/site-packages/litellm/llms/deepinfra/chat/transformation.py__init__DeepInfraConfig.__init__   sA      (--/!--/JCf}!2U3 *    c                     > [         TU ]  5       $ )N)super
get_config)clsr    s    r$   r*   DeepInfraConfig.get_config2   s    w!##r'   modelc                 
    / SQ$ )N)streamr   r   r   r   r   max_completion_tokensr   r   r   r   r   r   r   r    )r   r-   s     r$   get_supported_openai_params+DeepInfraConfig.get_supported_openai_params6   s    
 	
r'   non_default_paramsoptional_paramsdrop_paramsc                 t   U R                  US9nUR                  5        H  u  pgUS:X  a  US:X  a  US:X  a  SnUS:X  aY  US:w  aQ  US:w  aI  [        R                  S	L d  US	L a  S nMG  [        R                  R                  S
R                  U5      SS9eMv  Mx  US:X  a  XrS'   M  Xe;   d  M  Uc  M  XrU'   M     U$ )N)r-   r   r   z"mistralai/Mistral-7B-Instruct-v0.1g-C6?r   autononeTz{Deepinfra doesn't support tool_choice={}. To drop unsupported openai params from the call, set `litellm.drop_params = True`i  )messagestatus_coder0   r   )r2   r   litellmr6   utilsUnsupportedParamsErrorformat)r   r4   r5   r-   r6   supported_openai_paramsparamr#   s           r$   map_openai_params!DeepInfraConfig.map_openai_paramsI   s     #'"B"B"B"O.446LE&QJAA%VO **d2kT6I $%mmBB %b  %i  %i %% ),	 C   )8O 1105-1$-2E*3 74 r'   api_baseapi_keyc                 j    U=(       d    [        S5      =(       d    SnU=(       d    [        S5      nX4$ )NDEEPINFRA_API_BASEz#https://api.deepinfra.com/v1/openaiDEEPINFRA_API_KEYr   )r   rD   rE   dynamic_api_keys       r$   $_get_openai_compatible_provider_info4DeepInfraConfig._get_openai_compatible_provider_infom   s=    
  52354 	
 "H^4G%H((r'   r1   )NNNNNNNNNNNNN)#__name__
__module____qualname____firstlineno____doc__r   r   int__annotations__r   r   strdictr   listr   r   r   r   r   r   r   r   r   r   r%   classmethodr*   r2   boolrB   r   rJ   __static_attributes____classcell__)r    s   @r$   r
   r
      s|    (,x}+04M8E#t),-4 $Ix~$!%J% $J$Ax}&*hsm*'+D(5d#
$+!%K#%E8C=&*OXd^* E8D> .2K%T	*+2 ,048$(%)$(*.+/%)#*. $264#C=4  c4i 014 D>	4
 TN4 SM4 C=4 #3-4 uS$Y'(4 c]4 }4 "$4 ~4 eCI./4 
4* $ $
 
&" " " 	"
 " 
"H
) 
)08
)	x}hsm+	,
) 
)r'   r
   )
typingr   r   r   r<   +litellm.llms.openai.chat.gpt_transformationr   litellm.secret_managers.mainr   r
   r1   r'   r$   <module>r]      s"    ) )  G 7o)o o)r'   