
    `gj                     l    d Z ddlmZ ddlmZ ddlmZ  G d de      Z eddd	d
d      Z ee       y)u  Copilot / GitHub Models provider profile.

Copilot uses per-model api_mode routing:
  - GPT-5+ / Codex models → codex_responses
  - Claude models → anthropic_messages
  - Everything else → chat_completions (this profile covers that subset)

Key quirks for the chat_completions subset:
  - Editor attribution headers (via copilot_default_headers())
  - GitHub Models reasoning extra_body (model-catalog gated)
    )Any)register_provider)ProviderProfilec                   \    e Zd ZdZdddddedz  dedz  dedeeeef   eeef   f   fd	Z	y)
CopilotProfileu>   GitHub Copilot / GitHub Models — editor headers + reasoning.NF)modelreasoning_configsupports_reasoningr   r	   r
   returnc                   i }|rh|rf	 ddl m}  ||      }|rH|rF|j                  dd      }||vr$|dk(  rd|v rd}n|dk(  rd|v rd}nd|v rd}n|d   }||v rd|i|d	<   n	|rddi|d	<   |i fS |i fS # t        $ r Y |i fS w xY w)
Nr   )github_model_reasoning_effortseffortmediumxhighhighminimallow	reasoning)hermes_cli.modelsr   get	Exception)	selfr   r	   r
   ctx
extra_bodyr   supported_effortsr   s	            [/root/.hermes/venv/lib/python3.12/site-packages/plugins/model-providers/copilot/__init__.pybuild_api_kwargs_extrasz&CopilotProfile.build_api_kwargs_extras   s     &(
%L$B5$I!$)9-11(HEF %66!W,;L1L%+F#y0U>O5O%*F%)::%-F%6q%9F!223;V2D
;/&/7.BJ{+ 2~z2~  2~s   A!A1 1	B ?B )
__name__
__module____qualname____doc__strdictbooltupler   r        r   r   r      s_    H
 !(,#() Tz) +	)
 !) 
tCH~tCH~-	.)r'   r   copilot)zgithub-copilotzgithub-modelszgithub-modelgithub)COPILOT_GITHUB_TOKENGH_TOKENGITHUB_TOKENzhttps://api.githubcopilot.com)namealiasesenv_varsbase_url	auth_typeN)	r!   typingr   	providersr   providers.baser   r   r(   r&   r'   r   <module>r5      sG   
  ' *,_ ,^ 	IA, ' r'   