Unverified Commit 346e5645 authored by CHENYUE's avatar CHENYUE Committed by GitHub
Browse files

Add chat prefix completion feature to DeepSeek v3.2 (#31147)

parent 8be6432b
...@@ -169,6 +169,7 @@ def render_message( ...@@ -169,6 +169,7 @@ def render_message(
response_format = msg.get("response_format") response_format = msg.get("response_format")
tool_calls = msg.get("tool_calls") tool_calls = msg.get("tool_calls")
reasoning_content = msg.get("reasoning") or msg.get("reasoning_content") reasoning_content = msg.get("reasoning") or msg.get("reasoning_content")
is_prefix = msg.get("prefix", False)
if tools: if tools:
tools = tools_from_openai_format(tools) tools = tools_from_openai_format(tools)
...@@ -273,11 +274,14 @@ def render_message( ...@@ -273,11 +274,14 @@ def render_message(
+ thinking_end_token + thinking_end_token
) )
prompt += assistant_msg_template.format( if not tool_calls and is_prefix:
reasoning=thinking_part, prompt += summary_content
content=summary_content, else:
tool_calls=tool_calls_content, prompt += assistant_msg_template.format(
) reasoning=thinking_part,
content=summary_content,
tool_calls=tool_calls_content,
)
else: else:
raise NotImplementedError(f"Unknown role: {role}") raise NotImplementedError(f"Unknown role: {role}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment