InternLM / InternLM/lmdeploy

[Feature] qwen3 coder与qwen3的工具调用逻辑有差异,需要额外适配

Open
#3,840 4 comments 0 reactions 1 assignee Claimed by @RunningLeon View on GitHub
Dominant language
Python
Stars
8.1k
Forks
748
Avg merge
6d 2h
Merged PRs (30d)
54

Description

### Motivation

qwen3工具调用是json格式,qwen3 code的工具调用切换到xml格式

### Related resources

qwen3
工具调用:

{%- for tool in tools %}
--
{{- "\n" }}
{{- tool \| tojson }}
{%- endfor %}

工具回复:
\n{\"name\": , \"arguments\": }\n

qwen3 code
工具调用:

{%- for param_name, param_fields in tool.parameters.properties\|items %}
--
{{- '\n' }}
{{- '\n' ~ param_name ~ '' }}
{%- if param_fields.type is defined %}
{{- '\n' ~ (param_fields.type \| string) ~ '' }}
{%- endif %}
{%- if param_fields.description is defined %}
{{- '\n' ~ (param_fields.description \| trim) ~ '' }}
{%- endif %}
{%- set handled_keys = ['name', 'type', 'description'] %}
{{- render_extra_keys(param_fields, handled_keys) }}
{{- '\n' }}
{%- endfor %}

工具回复:
\n\n\nvalue_1\n\n\nThis is the value for the second parameter\nthat can span\nmultiple lines\n\n\n

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.