Skip to content

Use Claude Code, Codex, VSCode, Pi, and OpenCode (and 6 other harnesses) for free (1.3B+ free tokens) from your terminal, app, IDE, or phone, and now from the browser with native browser sessions (multi-harness + multi-model) like OpenClaw (voice supported + ToS friendly)

Python

Updated thinking keys

Alishahryar11d52e5d3bbec
diff --git a/providers/nvidia_nim/request.py b/providers/nvidia_nim/request.py
index 3c9901a2..140f19dd 100644
--- a/providers/nvidia_nim/request.py
+++ b/providers/nvidia_nim/request.py
@@ -94,7 +94,12 @@ def build_request_body(request_data: Any, nim: NimSettings) -> dict:
extra_body.setdefault("reasoning_split", True)
extra_body.setdefault(
"chat_template_kwargs",
- {"thinking": True, "reasoning_split": True, "clear_thinking": False},
+ {
+ "thinking": True,
+ "enable_thinking": True,
+ "reasoning_split": True,
+ "clear_thinking": False,
+ },
)
req_top_k = getattr(request_data, "top_k", None)
diff --git a/tests/test_nvidia_nim.py b/tests/test_nvidia_nim.py
index 14d967cf..df3cf684 100644
--- a/tests/test_nvidia_nim.py
+++ b/tests/test_nvidia_nim.py
@@ -76,6 +76,12 @@ async def test_build_request_body(nim_provider):
assert "thinking" in body["extra_body"]
assert body["extra_body"]["thinking"]["type"] == "enabled"
+ # Verify chat_template_kwargs includes both thinking keys for model compatibility
+ ctk = body["extra_body"]["chat_template_kwargs"]
+ assert ctk["thinking"] is True
+ assert ctk["enable_thinking"] is True
+ assert ctk["clear_thinking"] is False
+
@pytest.mark.asyncio
async def test_stream_response_text(nim_provider):