@miller-tech/uap 1.64.2 → 1.64.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
Binary file
|
|
@@ -4330,6 +4330,19 @@ def build_openai_request(
|
|
|
4330
4330
|
|
|
4331
4331
|
_apply_thinking_grammar(openai_body)
|
|
4332
4332
|
|
|
4333
|
+
# qwen3.5-enhanced.jinja (the MTP/130 config template) rejects an assistant
|
|
4334
|
+
# PREFILL (trailing assistant message) unless thinking is disabled VIA
|
|
4335
|
+
# chat_template_kwargs — the top-level `enable_thinking` flag is not read by
|
|
4336
|
+
# this template, so a prefill otherwise 400s ("Assistant response prefill is
|
|
4337
|
+
# incompatible with enable_thinking"). There is nothing to think about on a
|
|
4338
|
+
# continuation, so disable thinking the way the template actually reads.
|
|
4339
|
+
_final_msgs = openai_body.get("messages") or []
|
|
4340
|
+
if _final_msgs and isinstance(_final_msgs[-1], dict) and _final_msgs[-1].get("role") == "assistant":
|
|
4341
|
+
ctk = openai_body.setdefault("chat_template_kwargs", {})
|
|
4342
|
+
if isinstance(ctk, dict):
|
|
4343
|
+
ctk["enable_thinking"] = False
|
|
4344
|
+
openai_body.pop("enable_thinking", None)
|
|
4345
|
+
|
|
4333
4346
|
return openai_body
|
|
4334
4347
|
|
|
4335
4348
|
|