Ë
    ¼vëj%  ã                  ó4   — d Z ddlmZ ddlmZ ddlmZ dd„Zy)	zÏThe rate a call is priced at: the model's own row for this type of work when it is enabled, else the type's
'*' fallback (flagged on the usage row), else nothing, and the call is refused for want of a price.é    )Úannotations)ÚOptionalé   )ÚRatec           	     óŠ   — | j                  d||f«      j                  «       }|sy |d   \  }}}}}t        ||||||dk(  ¬«      S )Nz±SELECT model_key, type, unit, input_tokens_per_unit, output_tokens_per_unit FROM ai_model_rates WHERE type = %s AND enabled AND model_key IN (%s, '*') ORDER BY (model_key = '*')r   Ú*)Úfallback)ÚexecuteÚfetchallr   )	ÚconnÚ	model_keyÚtypeÚrowsÚkeyÚkindÚunitÚrate_inÚrate_outs	            ú_/var/www/html/strategist-ai/venv/lib/python3.12/site-packages/galaxiq_utils/ai_credits/rates.pyÚrate_forr   
   s`   € Ø�<‰<ð	%ð 
ˆyÐó	÷ $™8›:ð	 	ñ
 ØØ)-¨a©Ñ&€Cˆˆt�W˜hÜ��T˜4 ¨(¸cÀS¹jÔJÐJó    N)r   Ústrr   r   ÚreturnzOptional[Rate])Ú__doc__Ú
__future__r   Útypingr   Útypesr   r   © r   r   ú<module>r      s   ðñgå "å å ô	Kr   