
    0j                     6   d Z ddlmZ ddlmZ ddlmZ ddlmZ de	dz  de
fd	Zd
e	dz  de
fdZ G d de          Z eddddddd          Z eddddddd          Z eddddddddd d!"
  
        Z ee            ee            ee           dS )#a=  MiniMax provider profiles (international + China).

The default API-key routes use anthropic_messages because their base URLs end
with /anthropic. Users can opt MiniMax-M3 into the OpenAI-compatible endpoint
with base_url=https://api.minimax.io/v1; that route needs MiniMax-specific
reasoning controls in extra_body.
    )Any)urlparse)register_provider)ProviderProfilebase_urlNreturnc                    t          t          | pd                                                    }|j        pd                                dk    rdS |j                            d                                          }|dk    S )N zapi.minimax.ioF/z/v1)r   strstriphostnamelowerpathrstrip)r   parsedr   s      N/home/rurouni/.hermes/hermes-agent/plugins/model-providers/minimax/__init__.py"_is_minimax_global_openai_base_urlr      sv    c(.b))//1122F2$$&&*:::u;c""((**D5=    modelc                 t    t          | pd                                                                          }|dv S )Nr
   >   
minimax-m3minimax/minimax-m3)r   r   r   )r   
normalizeds     r   _is_minimax_m3r      s7    U[b!!''))//11J===r   c                   z    e Zd ZdZdddddedz  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 )
MiniMaxProfileu4   MiniMax — M3 OpenAI-compatible reasoning controls.N)reasoning_configr   r   r   r   r   contextr   c                    t          |          rt          |          si i fS ddi}t          |t                    r"|                    d          du rddi|d<   |i fS |dd	i|d<   |i fS )
au  Emit M3 reasoning controls for api.minimax.io/v1.

        MiniMax-M3's OpenAI-compatible endpoint keeps thinking inline unless
        ``reasoning_split`` is sent, so always request the split format on that
        route. ``thinking`` controls the M3 mode; Hermes' effort levels are not
        a MiniMax depth knob here, so they only select adaptive vs disabled.
        reasoning_splitTenabledFtypedisabledthinkingNadaptive)r   r   
isinstancedictget)selfr   r   r   r   
extra_bodys         r   build_api_kwargs_extrasz&MiniMaxProfile.build_api_kwargs_extras    s     2(;; 	>RWCXCX 	r6M&7%>
&-- 	"2B2F2Fy2Q2QUZ2Z2Z&,j%9Jz"r>!'&,j%9Jz"2~r   )	__name__
__module____qualname____doc__r(   r   r   tupler,    r   r   r   r      s        >>
 )- #   + Tz	
 *  
tCH~tCH~-	.     r   r   minimax)zmini-maxanthropic_messages)MINIMAX_API_KEYz https://api.minimax.io/anthropicapi_keyz
MiniMax-M3)namealiasesapi_modeenv_varsr   	auth_typedefault_aux_modelz
minimax-cn)zminimax-china
minimax_cn)MINIMAX_CN_API_KEYz"https://api.minimaxi.com/anthropiczminimax-oauth)minimax_oauthzminimax-oauth-iozMiniMax (OAuth)u6   MiniMax via OAuth browser flow — no API key requiredzhttps://api.minimax.io/r2   oauth_externalzMiniMax-M2.7)
r7   r8   r9   display_namedescription
signup_urlr:   r   r;   r<   )r0   typingr   urllib.parser   	providersr   providers.baser   r   boolr   r   r   r3   r=   r?   r2   r   r   <module>rI      s          ! ! ! ! ! ! ' ' ' ' ' ' * * * * * *t     >#* > > > > >
    _   B .	!!/"   ^	+!$1"  
 	1!"H(/$    '     *     -          r   