mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-07-03 14:05:26 +02:00
Support both kimi (thinking) and nemotron (enable_thinking) in chat_template_kwargs
This commit is contained in:
@@ -63,7 +63,9 @@ def build_request_body(request_data: Any, nim: NimSettings) -> dict:
|
||||
if request_extra:
|
||||
extra_body.update(request_extra)
|
||||
|
||||
extra_body.setdefault("chat_template_kwargs", {"enable_thinking": True})
|
||||
extra_body.setdefault(
|
||||
"chat_template_kwargs", {"thinking": True, "enable_thinking": True}
|
||||
)
|
||||
_set_extra(extra_body, "reasoning_budget", max_tokens)
|
||||
|
||||
req_top_k = getattr(request_data, "top_k", None)
|
||||
|
||||
@@ -100,6 +100,7 @@ async def test_build_request_body(nim_provider):
|
||||
|
||||
assert "extra_body" in body
|
||||
ctk = body["extra_body"]["chat_template_kwargs"]
|
||||
assert ctk["thinking"] is True
|
||||
assert ctk["enable_thinking"] is True
|
||||
assert body["extra_body"]["reasoning_budget"] == body["max_tokens"]
|
||||
|
||||
|
||||
@@ -101,7 +101,10 @@ class TestBuildRequestBody:
|
||||
nim = NimSettings()
|
||||
body = build_request_body(req, nim)
|
||||
extra = body["extra_body"]
|
||||
assert extra["chat_template_kwargs"] == {"enable_thinking": True}
|
||||
assert extra["chat_template_kwargs"] == {
|
||||
"thinking": True,
|
||||
"enable_thinking": True,
|
||||
}
|
||||
assert extra["reasoning_budget"] == body["max_tokens"]
|
||||
|
||||
def test_no_reasoning_params_in_extra_body(self):
|
||||
|
||||
Reference in New Issue
Block a user