
    L0&j              
           d Z ddlmZ ddlmZ ddlmZmZ  G d de          Z eddd	d
edddid          Z	 eddddedddid          Z
 ee	            ee
           dS )u   Kimi / Moonshot provider profiles.

Kimi has dual endpoints:
  - sk-kimi-* keys → api.kimi.com/coding (Anthropic Messages API)
  - legacy keys → api.moonshot.ai/v1 (OpenAI chat completions)

This module covers the chat_completions path (/v1 endpoint).
    )Any)register_provider)OMIT_TEMPERATUREProviderProfilec            	       ^    e Zd ZdZdddedz  deeeef         eeef         f         fdZdS )KimiProfileuE   Kimi/Moonshot — temperature omitted, thinking xor reasoning_effort.N)reasoning_configr	   returnc                8   i }i }|rt          |t                    sddi|d<   ||fS |                    dd          }|du rddi|d<   ||fS |                    d          pd                                                                }|d	v r||d
<   nddi|d<   ||fS )u  Kimi reasoning controls.

        Moonshot's wire shape treats ``extra_body.thinking`` (a binary toggle)
        and a top-level ``reasoning_effort`` as mutually exclusive — sending
        both is at best redundant and risks "cannot specify both 'thinking' and
        'reasoning_effort'" (HTTP 400). This mirrors the kimi-k2 handling on the
        opencode-go relay: send effort when one is requested, otherwise fall
        back to ``extra_body.thinking`` — never both.
        typeenabledthinkingTFdisabledeffort >   lowhighmediumreasoning_effort)
isinstancedictgetstriplower)selfr	   context
extra_body	top_levelr   r   s          Q/home/ubuntu/.hermes/hermes-agent/plugins/model-providers/kimi-coding/__init__.pybuild_api_kwargs_extrasz#KimiProfile.build_api_kwargs_extras   s     
	 	)z2BD'I'I 	) '-i%8Jz"y(("&&y$77e&,j%9Jz"y(( #&&x006B==??EEGG...,2I())&,i%8Jz"9$$    )	__name__
__module____qualname____doc__r   tuplestrr   r     r!   r   r   r      sk        OO 26#% #% #%#'$;#%	tCH~tCH~-	.#% #% #% #% #% #%r!   r   zkimi-coding)kimimoonshotzkimi-for-coding)KIMI_API_KEYKIMI_CODING_API_KEYzhttps://api.moonshot.ai/v1i }  z
User-Agentzhermes-agent/1.0zkimi-k2-turbo-preview)namealiasesenv_varsbase_urlfixed_temperaturedefault_max_tokensdefault_headersdefault_aux_modelzkimi-coding-cn)zkimi-cnzmoonshot-cn)KIMI_CN_API_KEYzhttps://api.moonshot.cn/v1N)r%   typingr   	providersr   providers.baser   r   r   r)   kimi_cnr(   r!   r   <module>r:      s          ' ' ' ' ' ' < < < < < < < <&% &% &% &% &%/ &% &% &%R {	34)&!#56-	 	 	 +	&!)&!#56-	 	 	  $     '     r!   