
    i                         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           dS )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                   p    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	dS )
CopilotProfileu>   GitHub Copilot / GitHub Models — editor headers + reasoning.NF)modelreasoning_configsupports_reasoningr   r	   r
   returnc                    i }|r\|rZ	 ddl m}  ||          }|r,|r*|                    dd          }|dk    rd}||v rd|i|d<   n	|rddi|d<   n# t          $ r Y nw xY w|i fS )Nr   )github_model_reasoning_effortseffortmediumxhighhigh	reasoning)hermes_cli.modelsr   get	Exception)	selfr   r	   r
   ctx
extra_bodyr   supported_effortsr   s	            M/home/piyush/.hermes/hermes-agent/plugins/model-providers/copilot/__init__.pybuild_api_kwargs_extrasz&CopilotProfile.build_api_kwargs_extras   s     &(
 	% 	LLLLLL$B$B5$I$I!$ C)9 C-11(HEEF((!'!2223;V2D
;/& C/7.BJ{+   2~s   AA 
AA)
__name__
__module____qualname____doc__strdictbooltupler   r        r   r   r      s        H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>r3      s   
 
       ' ' ' ' ' ' * * * * * *    _   > .	IA,    '     r%   