
    ^h
                     <    S r SSKrSSKJr  S\S\4S jrS\4S jrg)z1
Handles calculating cost for together ai models
    N)	CallTypes	call_typereturnc                    U[         R                  :X  d  U[         R                  :X  a	  [        U S9$ U R	                  5       n [
        R                  " SU 5      nSnUbw  [        UR                  S5      5      nUR                  SS5      nUb  [        U5      nOU $ US::  a  SnO,US	::  a  S
nO#US::  a  SnOUS::  a  SnOUS::  a  SnOUS::  a  SnUb  U$ U $ )z
Helper function for calculating together ai pricing.

Returns
- str - model pricing category if mapped else received model name
)
model_namez(\d+b)N   b g      @ztogether-ai-up-to-4bg       @ztogether-ai-4.1b-8bg      5@ztogether-ai-8.1b-21bg     D@ztogether-ai-21.1b-41bg      T@ztogether-ai-41.1b-80bg     [@ztogether-ai-81.1b-110b)r   	embedding
aembedding(get_model_params_and_category_embeddingslowerresearchstrgroupreplacefloat)r   r   re_params_matchcategoryparams_matchparams_billions         b/home/james-whalen/.local/lib/python3.13/site-packages/litellm/llms/together_ai/cost_calculator.pyget_model_params_and_categoryr      s     I'''9	8L8L+L7:NN!!#Jii:O H"?0034#++C4#"<0NS -Hs",Ht#-Ht#.Ht#.Hu$/HO    c                    U R                  5       n [        R                  " SU 5      nSnUbS  [        UR	                  S5      5      nUR                  SS5      nUb  [        U5      nOU $ US::  a  SnOUS::  a  S	nUb  U$ U $ )
z
Helper function for calculating together ai embedding pricing.

Returns
- str - model pricing category if mapped else received model name
z(\d+m)Nr   mr
      z together-ai-embedding-up-to-150mi^  z"together-ai-embedding-151m-to-350m)r   r   r   r   r   r   r   )r   r   r   r   params_millions        r   r   r   4   s     !!#Jii:O H"?0034#++C4#"<0NS 9Hs";HOr   )__doc__r   litellm.types.utilsr   r   r   r    r   r   <module>r#      s2    
 )
% %s %PC r   