tongyi 0.0.14 tool call incremental_output always false , the function name and parameters are repeatedly concatenated #153

Closed
opened 2026-02-16 10:18:15 -05:00 by yindo · 1 comment
Owner

Originally created by @ChronosLiu on GitHub (Mar 30, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.1

Plugin version

0.0.14

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

response = Generation.call(
                **params,
                result_format="message",
                stream=stream,
                incremental_output=False if tools else stream,
            )

When using the tool call, the incremental_output is always set to false. However, when processing the response results, the function name and parameters are repeatedly concatenated.

def _handle_tool_call_stream(self, response, tool_calls):
        tool_calls_stream = response.output.choices[0].message["tool_calls"]
        for tool_call_stream in tool_calls_stream:
            idx = tool_call_stream.get('index')
            if idx >= len(tool_calls):
                tool_calls.append(tool_call_stream)
            else:
                if tool_call_stream.get('function'):
                    func_name = tool_call_stream.get('function').get('name')
                    tool_call_obj = tool_calls[idx]
                    if func_name:
                        tool_call_obj['function']['name'] += func_name
                    args = tool_call_stream.get('function').get('arguments')
                    if args:
                        tool_call_obj['function']['arguments'] += args

https://help.aliyun.com/zh/model-studio/developer-reference/use-qwen-by-calling-api?spm=a2c4g.11186623.0.0.780e453a6XOeml#7f60648d6dfwr

✔️ Error log

{"status_code": 200, "request_id": "9dc7d225-12fd-97d4-a387-89f201b5aaaf", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "null", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatus", "arguments": "{\"sku"}}]}}]}, "usage": {"input_tokens": 221, "output_tokens": 15, "total_tokens": 236}}

{"status_code": 200, "request_id": "9dc7d225-12fd-97d4-a387-89f201b5aaaf", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "null", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatus", "arguments": "{\"skuNo\": \"AA33"}}]}}]}, "usage": {"input_tokens": 221, "output_tokens": 21, "total_tokens": 242}}

{"status_code": 200, "request_id": "9dc7d225-12fd-97d4-a387-89f201b5aaaf", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "tool_calls", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatus", "arguments": "{\"skuNo\": \"AA3315\"}"}}]}}]}, "usage": {"input_tokens": 221, "output_tokens": 24, "total_tokens": 245}}

tool call result

[{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatuscheckSkuStatuscheckSkuStatus", "arguments": "{\"sku{\"skuNo\": \"AA33{\"skuNo\": \"AA3315\"}"}}]
Originally created by @ChronosLiu on GitHub (Mar 30, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.1 ### Plugin version 0.0.14 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ``` response = Generation.call( **params, result_format="message", stream=stream, incremental_output=False if tools else stream, ) ``` When using the tool call, the incremental_output is always set to false. However, when processing the response results, the function name and parameters are repeatedly concatenated. ``` def _handle_tool_call_stream(self, response, tool_calls): tool_calls_stream = response.output.choices[0].message["tool_calls"] for tool_call_stream in tool_calls_stream: idx = tool_call_stream.get('index') if idx >= len(tool_calls): tool_calls.append(tool_call_stream) else: if tool_call_stream.get('function'): func_name = tool_call_stream.get('function').get('name') tool_call_obj = tool_calls[idx] if func_name: tool_call_obj['function']['name'] += func_name args = tool_call_stream.get('function').get('arguments') if args: tool_call_obj['function']['arguments'] += args ``` https://help.aliyun.com/zh/model-studio/developer-reference/use-qwen-by-calling-api?spm=a2c4g.11186623.0.0.780e453a6XOeml#7f60648d6dfwr ### ✔️ Error log ``` {"status_code": 200, "request_id": "9dc7d225-12fd-97d4-a387-89f201b5aaaf", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "null", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatus", "arguments": "{\"sku"}}]}}]}, "usage": {"input_tokens": 221, "output_tokens": 15, "total_tokens": 236}} {"status_code": 200, "request_id": "9dc7d225-12fd-97d4-a387-89f201b5aaaf", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "null", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatus", "arguments": "{\"skuNo\": \"AA33"}}]}}]}, "usage": {"input_tokens": 221, "output_tokens": 21, "total_tokens": 242}} {"status_code": 200, "request_id": "9dc7d225-12fd-97d4-a387-89f201b5aaaf", "code": "", "message": "", "output": {"text": null, "finish_reason": null, "choices": [{"finish_reason": "tool_calls", "message": {"role": "assistant", "content": "", "tool_calls": [{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatus", "arguments": "{\"skuNo\": \"AA3315\"}"}}]}}]}, "usage": {"input_tokens": 221, "output_tokens": 24, "total_tokens": 245}} ``` tool call result ``` [{"index": 0, "id": "call_5346621c6a114f9494b8f4", "type": "function", "function": {"name": "checkSkuStatuscheckSkuStatuscheckSkuStatus", "arguments": "{\"sku{\"skuNo\": \"AA33{\"skuNo\": \"AA3315\"}"}}] ````
yindo added the bug label 2026-02-16 10:18:15 -05:00
yindo closed this issue 2026-02-16 10:18:15 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 16, 2025):

Hi, @ChronosLiu. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a bug in plugin version 0.0.14 where the incremental_output flag is always false.
  • This causes repeated concatenation of function names and parameters in the _handle_tool_call_stream method.
  • The response processing appends rather than replaces function call data.
  • You provided code snippets and reproduction steps to illustrate the problem.
  • There has been no further activity or comments on this issue.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here.
  • If I do not hear back within 5 days, this issue will be automatically closed.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 16, 2025): Hi, @ChronosLiu. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a bug in plugin version 0.0.14 where the `incremental_output` flag is always false. - This causes repeated concatenation of function names and parameters in the `_handle_tool_call_stream` method. - The response processing appends rather than replaces function call data. - You provided code snippets and reproduction steps to illustrate the problem. - There has been no further activity or comments on this issue. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of the dify-official-plugins repository by commenting here. - If I do not hear back within 5 days, this issue will be automatically closed. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#153