[Bugfix] Attach request-level tools to existing system message in DeepSeek V4 Python renderer (#51856)

Signed-off-by: Jason Yao <wsyjh8@gmail.com>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
This commit is contained in:
Jason
2026-09-18 11:07:25 +08:00
committed by GitHub
co-authored by Chauncey
parent 70df48dc3d
commit 2909ad8fa4
3 changed files with 157 additions and 4 deletions
@@ -1,4 +1,4 @@
<|begin▁of▁sentence|>
<|begin▁of▁sentence|>You are a helpful assistant.
## Tools
@@ -26,7 +26,7 @@ Otherwise, output directly after </think> with tool calls or final response.
{"name": "search", "description": "Search the web for information", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "Search query"}, "num_results": {"type": "integer", "description": "Number of results to return"}}, "required": ["query"]}}
You MUST strictly follow the above defined tool name and parameter schemas to invoke tool calls.
You are a helpful assistant.<|User|>What's the weather in Beijing?<|Assistant|><think>The user wants to know the weather in Beijing. I should use the get_weather tool.</think>
<|User|>What's the weather in Beijing?<|Assistant|><think>The user wants to know the weather in Beijing. I should use the get_weather tool.</think>
<|DSML|tool_calls>
<|DSML|invoke name="get_weather">