+
    kHàjð  ã            
       ó®   € R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ]P                  ! ]4      t ! R R]
4      t]! RRRRR	R
RR7      t]! ]4       R# )z"Native Anthropic provider profile.N)Úopen_credentialed_url)Úregister_provider)ÚProviderProfilec                   óF   a € ] tR t^t o RtRRRRRR/V 3R lR lltR	tV tR# )
ÚAnthropicProfileu7   Native Anthropic â€” uses x-api-key header, not Bearer.Úapi_keyNÚbase_urlÚtimeoutg       @c          	      ól   <€ V ^8„  d   QhRS[ R,          RS[ R,          RS[RS[S[ ,          R,          /# )é   r   Nr   r	   Úreturn)ÚstrÚfloatÚlist)ÚformatÚ__classdict__s   "€ÚO/home/ubuntu/.hermes/hermes-agent/plugins/model-providers/anthropic/__init__.pyÚ__annotate__ÚAnthropicProfile.__annotate__   s>   ø€ ÷ ñ Ù �*ðÙ7:¸TµzðÙSXðá	‰c��TÕ	ñó    c               ó¢  aaaa€ S'       g   R# ^ RI HpHoHp R VVVV3R llp . p\	        4       pRp	\        V4       FA  p
V! V	4      pVP                  R VP                  R. 4       4       4       V! W¸4      p	V	e   KA   M	  \        \        P                  V4      4      #   \         d"   p\        P                  RT4        Rp?R# Rp?ii ; i)z¯Anthropic uses x-api-key header and anthropic-version. ``/v1/models`` is cursor-paginated
(default page 20, smaller than the live catalog), so follow ``has_more``/``last_id``.N)Ú_ANTHROPIC_MODELS_MAX_PAGESÚ_anthropic_models_urlÚ_anthropic_next_cursorc                ó2   € V ^8„  d   QhR\         R,          /# )r   Úafter_idN)r   )r   s   "r   r   Ú3AnthropicProfile.fetch_models.<locals>.__annotate__   s   € ÷ 	8ñ 	8œC $�Jñ 	8r   c                 ó`  <€ \         P                  P                  S! SV R 7      4      pRS3RR3 F  w  r#VP                  W#4       K  	  \	        VSR7      ;_uu_ 4       p\
        P                  ! VP                  4       P                  4       4      uuRRR4       #   + '       g   i     R# ; i))r   z	x-api-key)r	   N)zanthropic-versionz
2023-06-01)ÚAcceptzapplication/json)	ÚurllibÚrequestÚRequestÚ
add_headerr   ÚjsonÚloadsÚreadÚdecode)	r   ÚreqÚkÚvÚrespr   r   r   r	   s	   &    €€€€r   Ú_pageÚ,AnthropicProfile.fetch_models.<locals>._page   s€   ø€ Ü—.‘.×(Ñ(Ñ)>¸xÐRZÔ)[Ó\ˆCØ% wÐ/Ð1TÐVtÓu‘�Ø—‘˜qÖ$ñ vä& s°G×<Õ<ÀÜ—z’z $§)¡)£+×"4Ñ"4Ó"6Ó7÷ =×<×<Ó<ús   Á2BÂB-	c              3   óv   "  € T F/  p\        V\        4      '       g   K  R V9   g   K$  VR ,          x € K1  	  R# 5i)ÚidN)Ú
isinstanceÚdict)Ú.0Úms   & r   Ú	<genexpr>Ú0AnthropicProfile.fetch_models.<locals>.<genexpr>'   s0   é € ÐiÑ/C¨!ÄzÐRSÔUY×GZœgÐ_cÐghÑ_hœg˜a ŸgšgÓ/Cùs   ‚9Ÿ9¨9Údatazfetch_models(anthropic): %s)Úhermes_cli.modelsr   r   r   ÚsetÚrangeÚextendÚgetr   r0   ÚfromkeysÚ	ExceptionÚloggerÚdebug)Úselfr   r   r	   r   r   r+   ÚmodelsÚseen_cursorsÚcursorÚ_r5   Úexcr   s   &ddd         @r   Úfetch_modelsÚAnthropicProfile.fetch_models   s±   û€ ÷
 ÙßpÑp÷	8ó 	8ð	Ø "ˆFÜ%(£UˆLØ!%ˆFÜÐ6Ö7�Ù˜V“}�Ø—‘Ñi¨t¯x©x¸ÀÔ/CÓiÔiÙ/°ÓC�Ø”>Ùñ 8ô œŸ™ fÓ-Ó.Ð.øÜô 	Ü�L‰LÐ6¸Ô<Ýûð	ús   ¦AB" Â !B" Â"CÂ-C	Ã	C© )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__rE   Ú__static_attributes__Ú__classdictcell__)r   s   @r   r   r      s/   ø‡ € ÙAðØ'+ðØDHðØ[^÷÷ ð r   r   Ú	anthropicÚanthropic_messageszhttps://api.anthropic.comr   zclaude-haiku-4-5-20251001)ÚnameÚaliasesÚapi_modeÚenv_varsr   Ú	auth_typeÚdefault_aux_model)Úclaudezclaude-oauthzclaude-code)ÚANTHROPIC_API_KEYÚANTHROPIC_TOKENÚCLAUDE_CODE_OAUTH_TOKEN)rL   r#   ÚloggingÚurllib.requestr   Úhermes_cli.urllib_securityr   Ú	providersr   Úproviders.baser   Ú	getLoggerrH   r=   r   rO   rG   r   r   Ú<module>ra      sa   ðÙ (ã Û Û å <Ý 'Ý *à	×	Ò	˜8Ó	$€ô �ô  ñF Ø	ÐGÐRfØPØ(°IÐQlô€	ñ �)Ö r   