
    ^h)	                     l    S r SSKJrJr  SSKJr  SSKJr  SSKJ	r	   SS\
S\S\\   S	\\\4   4S
 jjrg)zX
Helper util for handling azure openai-specific cost calculation
- e.g.: prompt caching
    )OptionalTuple)verbose_logger)Usage)get_model_infomodelusageresponse_time_msreturnc                    [        U SS9nSnUR                  nUR                  (       a5  UR                  R                  (       a  UR                  R                  nXT-
  nXSS   -  nUS   US   -  nUR	                  S5      b'  U(       a   XdUR	                  SS5      =(       d    S-  -  nS	U;   aD  US	   b>  Ub;  [
        R                  " S
U  SUR	                  S	5       SU 35        SnUS	   U-  S-  nXg4$ )a3  
Calculates the cost per token for a given model, prompt tokens, and completion tokens.

Input:
    - model: str, the model name without provider prefix
    - usage: LiteLLM Usage block, containing anthropic caching information

Returns:
    Tuple[float, float] - prompt_cost_in_usd, completion_cost_in_usd
azure)r   custom_llm_providerNinput_cost_per_tokencompletion_tokensoutput_cost_per_tokencache_read_input_token_costr   output_cost_per_secondz
For model=z - output_cost_per_second: z; response time: i  )r   prompt_tokensprompt_tokens_detailscached_tokensgetr   debug)r   r	   r
   
model_infor   non_cached_text_tokensprompt_costcompletion_costs           ]/home/james-whalen/.local/lib/python3.13/site-packages/litellm/llms/azure/cost_calculation.pycost_per_tokenr      s3     eIJ#'M"00""u'B'B'P'P33AA!7!G/=S2TTK 	!"Z0G%HH 
 ~~34@]NN8!<A
 	
 	!J./0<(::>>Jb;c:ddu  wG  vH  I	
 $%=>AQQTXX''    N)g        )__doc__typingr   r   litellm._loggingr   litellm.types.utilsr   litellm.utilsr   strfloatr    r   r   <module>r(      sQ   
 # + % ( CF0(0(0(080(
5%<0(r   