Skip to content

deepseek v3.2 support#11

Closed
hksdpc255 wants to merge 1 commit intoochafik:mainfrom
hksdpc255:patch-1
Closed

deepseek v3.2 support#11
hksdpc255 wants to merge 1 commit intoochafik:mainfrom
hksdpc255:patch-1

Conversation

@hksdpc255
Copy link
Copy Markdown
Collaborator

Deepseek V3.2 uses a new tool-call format like this:

<|DSML|function_calls>
<|DSML|invoke name="get_datetime">
<|DSML|parameter name="timezone" string="true">Asia/Shanghai</|DSML|parameter>
</|DSML|invoke>
</|DSML|function_calls>
<|DSML|function_calls>
<|DSML|invoke name="search">
<|DSML|parameter name="query" string="true">search agent benchmark 2024</|DSML|parameter>
<|DSML|parameter name="topn" string="false">10</|DSML|parameter>
<|DSML|parameter name="source" string="true">web</|DSML|parameter>
</|DSML|invoke>
<|DSML|invoke name="search">
<|DSML|parameter name="query" string="true">搜索智能体 基准测试</|DSML|parameter>
<|DSML|parameter name="topn" string="false">10</|DSML|parameter>
<|DSML|parameter name="source" string="true">web</|DSML|parameter>
</|DSML|invoke>
</|DSML|function_calls>

Maybe we should update the polyfill detection code for this.

@ochafik ochafik closed this in #17 Dec 20, 2025
ochafik added a commit that referenced this pull request Dec 20, 2025
## Summary

Implements support for DeepSeek V3.2's DSML (Domain Specific Markup
Language) format, superseeds #11 (cc/ @hksdpc255)

DeepSeek V3.2 doesn't provide a Jinja template but uses a custom Python
encoding with DSML format:
```xml
<|DSML|parameter name="key" string="true">value</|DSML|parameter>
```

## Changes

- **Simplified argument needle detection**: Changed from specific
patterns (`"argument_needle":`, `="argument_needle"`) to broader
`"argument_needle"` pattern which matches both JSON keys and DSML
attribute values
- **Local .jinja file support**: Fetch script now handles local `.jinja`
files in MODEL_IDS (for synthetic test templates)
- **Synthetic template**: Added `synthetic-deepseek-v3.2-dsml.jinja`
replicating V3.2's Python encoding logic (from `encoding_dsv32.py`)
- **Integrated testing**: Added synthetic template to MODEL_IDS,
generates 3 test cases (simple, system, tool_use)

## Test plan

- [x] All 248 tests pass
- [x] Capability detection correctly identifies DSML format
(`supports_tool_calls: true`, `requires_object_arguments: true`)
- [x] Synthetic template tests pass for all contexts

Closes #11

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant