ó
    -ÐåhL  ã                   óL   • S SK JrJr  S\4S jrS\S\4S jrS\S\\   4S jrg)é    )ÚAnyÚListÚreturnc                  ó^   •  SS K n U R                  5       $ ! [         a    [        S5      ef = f)Nr   z¨Could not import anthropic python package. This is needed in order to accurately tokenize the text for anthropic models. Please install it with `pip install anthropic`.)Ú	anthropicÚImportErrorÚ	Anthropic)r   s    ÚW/root/34ku/venv/lib/python3.13/site-packages/langchain_community/utilities/anthropic.pyÚ_get_anthropic_clientr      s?   € ð
Ûð ×ÑÓ Ð øô ó 
ÜðTó
ð 	
ð
ús   ‚ –,Útextc                 ó4   • [        5       nUR                  U S9$ )z-Get the number of tokens in a string of text.)r   )r   Úcount_tokens)r   Úclients     r
   Úget_num_tokens_anthropicr      s   € ä"Ó$€FØ×Ñ DÐÐ)Ð)ó    c                 óp   • [        5       nUR                  5       nUR                  U 5      nUR                  $ )z'Get the token ids for a string of text.)r   Úget_tokenizerÚencodeÚids)r   r   Ú	tokenizerÚencoded_texts       r
   Úget_token_ids_anthropicr      s4   € ä"Ó$€FØ×$Ñ$Ó&€IØ×#Ñ# DÓ)€LØ×ÑÐr   N)Útypingr   r   r   ÚstrÚintr   r   © r   r
   Ú<module>r      s>   ðß ð	!˜sô 	!ð* 3ð *¨3ô *ð #ð ¨$¨s©)õ r   