
    @=j
                        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
           dS )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
ZdS )OllamaCloudProfileuA   Ollama Cloud — maps xhigh→max via top-level reasoning_effort.N)reasoning_configr	   dict | Nonectxr   return%tuple[dict[str, Any], dict[str, Any]]c               @   i }|rt          |t                    r|                    dd          }|du ri i fS |                    d          pd                                                                }|si i fS |dk    ri i fS |dv rd|d	<   n|d
v r||d	<   n||d	<   i |fS )u   Emit top-level ``reasoning_effort`` for Ollama Cloud.

        The ``supports_reasoning`` flag passed by the transport is
        deliberately ignored — this profile always handles reasoning
        when ``reasoning_config`` is present.
        enabledTFeffort none)xhighmaxr   reasoning_effort)lowmediumhigh)
isinstancedictgetstriplower)selfr	   r   	top_levelr   r   s         S/home/rurouni/.hermes/hermes-agent/plugins/model-providers/ollama-cloud/__init__.pybuild_api_kwargs_extrasz*OllamaCloudProfile.build_api_kwargs_extras   s     %'	 	7
+;T B B 	7&**9d;;G%2v&**844:AACCIIKKF 2v2v)))05	,--44406	,-- 17	,-9}    )r	   r
   r   r   r   r   )__name__
__module____qualname____doc__r!    r"   r    r   r      s=        KK
 )-! ! ! ! ! ! ! !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>r3      s    " # " " " " "       ' ' ' ' ' ' * * * * * *$ $ $ $ $ $ $ $N "!	+ $    ,     r"   