Skip to content

Qwen3-235B-A22B-Thinking-2507 generate content when tool_call and stream mode #1755

@NiuBlibing

Description

@NiuBlibing

Description

When stream mode true, the response contains content "\n\n" between reasoning and tool_call; but with stream model false, it didn't generate content "\n\n".

Is there some thing different, I don't want the content "\n\n" between reasoning and tool_call.

Image

Reproduction

{
  "model": "Qwen3-235B-A22B-Thinking-2507",
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "search_law_articles",
        "parameters": {
          "type": "object",
          "properties": {
            "level": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "搜索条件:法规类型"
            },
            "query": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "查询语句"
            },
            "title": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "法律标题"
            },
            "article": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "法律条款序号,如 第十条"
            },
            "content": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "法律条款及内容,如 第十条 贷款人委托支付"
            },
            "pub_department": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "发布部门"
            },
            "pub_time_after": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "搜索条件:发布时间晚于此时间,格式如2025-06-20"
            },
            "pub_time_before": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "搜索条件:发布时间早于此时间,格式如2025-06-20"
            },
            "imply_time_after": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "搜索条件:实施时间晚于此时间,格式如2025-06-20"
            },
            "imply_time_before": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "default": null,
              "description": "搜索条件:实施时间早于此时间,格式如2025-06-20"
            }
          }
        },
        "description": "此工具用于搜索法条内容, 库中是按照法律条目进行存储, 查询可选多个查询过滤条件"
      }
    }
  ],
  "stream": true,
  "messages": [
    {
      "role": "user",
      "content": [
        {
          "text": "帮我解读下网络安全法",
          "type": "text"
        }
      ]
    }
  ]
}

Logs

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":""}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":"试试"}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":"title"}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":"参数"}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"reasoning_content":"。\n"}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"content":"\n\n"}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"tool_calls":[{"id":"call_fa32e85be37342cb9164024a","function":{"arguments":"","name":"search_law_articles"},"type":"function","index":0}]}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"tool_calls":[{"function":{"arguments":"{\"title\": \""},"type":"function","index":0}]}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"tool_calls":[{"function":{"arguments":"\\u4e2d\\u534e\\u4eba\\u6c11"},"type":"function","index":0}]}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"tool_calls":[{"function":{"arguments":"\\u5171\\u548c\\u56fd"},"type":"function","index":0}]}}]}

data: {"id":"3d3dd0163fca4a54bed10ad9f93a5042","created":1764040110,"model":"qwen3-235b-a22b-thinking-2507","object":"chat.completion.chunk","choices":[{"index":0,"delta":{"tool_calls":[{"function":{"arguments":"\\u7f51\\u7edc\\u5b89\\u5168"},"type":"function","index":0}]}}]}

Environment Information

H200 with vllm

Known Issue

  • The issue hasn't been already addressed in Documentation, Issues, and Discussions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions