diff --git a/docs/api.md b/docs/api.md index 2942b388e..bb08d9b42 100644 --- a/docs/api.md +++ b/docs/api.md @@ -664,9 +664,14 @@ parsing. Tagged parameters, as in GLM, retain malformed JSON values as strings. DeepSeek retains the original text of a `string="false"` parameter that cannot be decoded inside the argument object. Invalid JSON in a whole argument document or a typed XTML value fails parsing. Required mode needs at least one declared -tool, adds an instruction to call a tool to the prompt, and validates that -generation produced at least one -completed call to a declared tool. Sampling is unchanged; no calls are fabricated +tool. Jinja-template and TMLv0 prompt encoders add a system instruction to call +a tool to the prompt. The native DeepSeek V4 and V4.1 prompt encoders add none: +in thinking mode they render required mode identically to `"auto"` so reasoning +starts in ``, and in non-thinking mode their template opens the DSML +tool-call block at the end of the prompt so generation starts inside the +tool-call envelope. In all modes, including DeepSeek thinking mode, completion +validates that generation produced at least one completed call to a declared +tool. Sampling is unchanged; no calls are fabricated and no retries are attempted. Missing calls, including output truncated before a complete call, produce HTTP 500 for buffered requests or a terminal error event for streams. A required-mode stream may deliver partial text before that error, but does not diff --git a/docs/core-design.md b/docs/core-design.md index 09826a289..725b1a2d0 100644 --- a/docs/core-design.md +++ b/docs/core-design.md @@ -1724,8 +1724,11 @@ While device grammar masking is active (outside open reasoning, including prose and tool calls), the request uses MTP width one and the [native replay loop](#native-replay-loop) keeps one step in flight for any decode batch containing it. -`tool_choice=required` adds a prompt instruction and requires a completed call -to a declared tool. Without a grammar it uses ordinary sampling. Named tool +`tool_choice=required` requires a completed call to a declared tool; +Jinja-template and TMLv0 prompt encoders also add a system prompt instruction, +while native DeepSeek V4 and V4.1 encoders do not (see the +[API contracts](api.md#conversation-and-tool-semantics)). Without a grammar it +uses ordinary sampling. Named tool selection filters the definitions to that tool; it does not by itself enable a grammar. The encoder requires a completed call to the selected tool and rejects other tool names. It omits ordinary answer text but preserves reasoning and arguments.