Repository navigation
chat: enable tool call in thinking for DS4 - #26269
Conversation
| reasoning = p.optional(THINK_START + p.reasoning(p.until(THINK_END)) + THINK_END); | ||
| reasoning_with_tc = THINK_START + p.reasoning(p.until_one_of({ FC_START, THINK_END })) + obligatory_tool_calls; | ||
| allow_reasoning_with_tc = true; |
There was a problem hiding this comment.
Think it's cleaner if you terminate thinking with a p.literal(THINK_END) | p.peek(p.literal(FC_START)). Then you don't need this "tool call in reasoning logic."
|
Not seeing any XML failures on this branch. Been chugging along for an hour or so. |
|
@ggml-org/maintainers need 1 more approval please |
ServeurpersoCom
left a comment
There was a problem hiding this comment.
Tested on my server with DeepSeek V4 Flash, both paths work: classic think close + tool call, and forced tool call inside an open think via continuation prefill, clean parse every time.
One nit, grammar_lazy = has_tools && !require_tools skips response_format enforcement when tools and json_schema coexist with auto tool choice, worth a && !has_response_format
|
@aldehir good to merge? |
|
Yes, special consideration needs to be taken for |
|
Follow up to make encoding match the reference implementation: #26398 |
Overview
Mirror to #26252 - allows tool calls in reasoning for DS4
Requirements