mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-23 15:08:16 +02:00
Ajoute un interrupteur « Mode réflexion » (think) pour les modèles thinking
Certains modèles « thinking » ne renvoyaient que du raisonnement, sans reponse finale -> erreur. Nouvel interrupteur global `think` (Reglages > Generation) : - think=false envoie `think:false` a Ollama pour desactiver le raisonnement - repli automatique si le modele refuse le parametre (does not support thinking) - message d'erreur mis a jour pour pointer vers l'interrupteur Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
b4fc8cee3d
commit
5c1b92daa3
7 files changed
+41
-3
No files matched your search
@@ -106,6 +106,7 @@ class OllamaClient:
|
||||
*,
|
||||
tools: list[dict] | None = None,
|
||||
options: dict | None = None,
|
||||
think: bool | None = None,
|
||||
stream: bool = True,
|
||||
) -> AsyncIterator[dict]:
|
||||
"""Conversation avec le modèle, en streaming token par token."""
|
||||
@@ -114,6 +115,9 @@ class OllamaClient:
|
||||
payload["tools"] = tools
|
||||
if options:
|
||||
payload["options"] = options
|
||||
# think=False désactive le raisonnement des modèles « thinking ».
|
||||
if think is not None:
|
||||
payload["think"] = think
|
||||
|
||||
async with httpx.AsyncClient(
|
||||
timeout=_STREAM_TIMEOUT, follow_redirects=True
|
||||
|
||||
Reference in new issue
Block a user