+
    iHàj  ã                  óN   € R t ^ RIHt ^ RIt]P                  ! ]4      tR R ltR# )zWNon-streaming chat completions that still feed response headers to the credits capture.)ÚannotationsNc               ó   € V ^8„  d   QhRR/# )é   Ú
api_kwargsÚdict© )Úformats   "ÚB/home/ubuntu/.hermes/hermes-agent/agent/chat_completion_headers.pyÚ__annotate__r
   
   s   € ÷ ñ À$ñ ó    c           	     ó¢  € \        V RR4      p\        V RR4      R8w  g   \        VRR4      RJd'   VP                  P                  P                  ! R/ VB # \        \        \        VR	R4      R
R4      RR4      pVf'   VP                  P                  P                  ! R/ VB # TP                  ! R/ VB p^ RIHp V! V4      '       g   VP                  4       # V P                  V P                  V P                  V P                  3 F  p V! V4       K  	  VP                  4       #   \         d    \        P                  RRR7        KE  i ; i)aó  Non-streaming ``chat.completions.create`` that also feeds the response headers to the
rate-limit / credits capture, as ``_chat_stream_created`` does for streams.

The parsed ``ChatCompletion`` drops headers, so without this a non-streaming turn never
observes ``x-nous-credits-*`` (usage-window ``spend_source`` / gauges go stale). The SDK's
``with_raw_response`` returns the same request with headers attached; a client without it keeps
the plain call. Usage-window plans
only: every other provider, and a Nous session not yet known to be on a window plan (the
session-start seed or a stream header establishes it), keep the plain call; headers are
captured only when the response itself is the usage-window kind. A capture failure never
fails the turn.
Ú_credits_stateNÚproviderÚ ÚnousÚis_usage_windowFTÚchatÚcompletionsÚwith_raw_response)Úresponse_is_usage_windowz#non-streaming header capture failed)Úexc_infor   )Úgetattrr   r   ÚcreateÚagent.credits_trackerr   ÚparseÚ_capture_rate_limitsÚ_capture_creditsÚ_capture_nous_model_switchÚ_check_openrouter_cache_statusÚ	ExceptionÚloggerÚdebug)ÚagentÚclientr   ÚstateÚraw_apiÚrawr   Úcaptures   &&&     r	   Ú"_chat_completion_capturing_headersr(   
   s4  € ô �EÐ+¨TÓ2€EÜˆu�j "Ó%¨Ô/´7¸5ÐBSÐUZÓ3[ÐcgÓ3gØ�{‰{×&Ñ&×-Ò-Ñ;°
Ñ;Ð;Ü”gœg f¨f°dÓ;¸]ÈDÓQÐSfÐhlÓm€GØ‚Ø�{‰{×&Ñ&×-Ò-Ñ;°
Ñ;Ð;Ø
�.Š.Ñ
&˜:Ñ
&€CÝ>Ù# C×(Ò(Ø�y‰y‹{ÐØ×.Ñ.°×0FÑ0FØ×4Ñ4°e×6ZÑ6Zó\ˆð	OÙ�CŽLñ\ð �9‰9‹;Ðøô ô 	OÜ�L‰LÐ>ÈˆL×Nð	Oús   ÄD(Ä("EÅE)Ú__doc__Ú
__future__r   ÚloggingÚ	getLoggerÚ__name__r    r(   r   r   r	   Ú<module>r.      s#   ðÙ ]å "ã à	×	Ò	˜8Ó	$€÷r   