
    `gj\                    x    d Z ddlm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  Ollama Cloud provider profile.

Ollama Cloud's OpenAI-compatible ``/v1/chat/completions`` endpoint
supports top-level ``reasoning_effort`` with values ``none``, ``low``,
``medium``, ``high``, and ``max`` (the last being undocumented but
empirically confirmed for DeepSeek V4 — ``max`` produces ~2.5× more
thinking tokens than ``high``).

This profile maps Hermes's ``xhigh`` → ``max`` to unlock DeepSeek V4's
"Max thinking" tier through Ollama Cloud.  ``low`` / ``medium`` / ``high``
pass through unchanged.

When reasoning is explicitly disabled (``enabled: false`` or
``effort: "none"``), ``reasoning_effort`` is omitted entirely so the
model runs in non-thinking mode.
    )annotations)Any)register_provider)ProviderProfilec                  .    e Zd ZdZddd	 	 	 	 	 	 	 ddZy)OllamaCloudProfileuA   Ollama Cloud — maps xhigh→max via top-level reasoning_effort.NF)reasoning_configsupports_reasoningc               &   i }|si i fS |rt        |t              rt|j                  dd      }|du ri ddifS |j                  d      xs dj                         j	                         }|si i fS |dk(  ri ddifS |dv r	d	|d<   i |fS |d
v r||d<   i |fS )u  Emit top-level ``reasoning_effort`` for Ollama Cloud thinking models.

        Gated on ``supports_reasoning``, which the transport resolves from the
        model's native ``/api/show`` ``capabilities`` (``thinking``). Models
        without the thinking capability (e.g. ``gemma3``, ``qwen3-coder``) get
        no ``reasoning_effort`` at all — emitting it there is a no-op the API
        ignores, and gating avoids sending a meaningless field.
        enabledTFreasoning_effortnoneeffort )xhighmaxultrar   )lowmediumhigh)
isinstancedictgetstriplower)selfr	   r
   ctx	top_levelr   r   s          `/root/.hermes/venv/lib/python3.12/site-packages/plugins/model-providers/ollama-cloud/__init__.pybuild_api_kwargs_extrasz*OllamaCloudProfile.build_api_kwargs_extras   s     %'	!r6M
+;T B&**9d;G% .777&**84:AACIIKF 2v.7772205	,- 9} 4406	,- 9}    )r	   zdict | Noner
   boolr   r   returnz%tuple[dict[str, Any], dict[str, Any]])__name__
__module____qualname____doc__r     r!   r   r   r      s:    K
 )-#(	1 &1 !	1
 1 
/1r!   r   zollama-cloud)ollama_cloudznemotron-3-nano:30b)OLLAMA_API_KEYzhttps://ollama.com/v1)namealiasesdefault_aux_modelenv_varsbase_urlN)r'   
__future__r   typingr   	providersr   providers.baser   r   r)   r(   r!   r   <module>r4      sJ   " #  ' *4 4n "	+ $ , r!   