agent functioncalling JSONDecodeError #160

Closed
opened 2026-02-16 10:18:16 -05:00 by yindo · 31 comments
Owner

Originally created by @planwk on GitHub (Apr 1, 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 search for existing issues, 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.1.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I created an agent with the strategy of function calling. This strategy often appears before calling the tool and reports the following error:
Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"JSONDecodeError","message":"Expecting ':' delimiter: line 1 column 5 (char 4)"}
The JSON format is not compliant as specified by prompts. How to solve this problem? If one wants to track more detailed information, how to set it up?

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @planwk on GitHub (Apr 1, 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 [search for existing issues](https://github.com/langgenius/dify/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.1.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I created an agent with the strategy of function calling. This strategy often appears before calling the tool and reports the following error: Run failed: Failed to transform agent message: PluginInvokeError: {"args":{},"error_type":"JSONDecodeError","message":"Expecting ':' delimiter: line 1 column 5 (char 4)"} The JSON format is not compliant as specified by prompts. How to solve this problem? If one wants to track more detailed information, how to set it up? ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:16 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 1, 2025):

Hello @planwk! I'm here to help you with bugs, questions, and becoming a contributor. Feel free to ask anything you need assistance with while waiting for a human maintainer.

To solve the JSONDecodeError you're encountering with the function calling strategy in your self-hosted Dify agent, ensure that the JSON data being processed is correctly formatted. This error typically occurs when the JSON data is not properly structured. You can add logging to capture the problematic JSON data before attempting to decode it, which will help you track more detailed information about the error.

Here's how you can modify your code to include logging for debugging purposes:

import json
import logging

logger = logging.getLogger(__name__)

# In the extract_tool_calls method
def extract_tool_calls(self, llm_result_chunk: LLMResultChunk) -> list[tuple[str, str, dict[str, Any]]]:
    tool_calls = []
    for prompt_message in llm_result_chunk.delta.message.tool_calls:
        args = {}
        if prompt_message.function.arguments != "":
            try:
                args = json.loads(prompt_message.function.arguments)
            except json.JSONDecodeError as e:
                logger.error(f"JSONDecodeError: {e} - Arguments: {prompt_message.function.arguments}")
                # Handle the error or re-raise
        tool_calls.append(
            (
                prompt_message.id,
                prompt_message.function.name,
                args,
            )
        )
    return tool_calls

# In the extract_blocking_tool_calls method
def extract_blocking_tool_calls(self, llm_result: LLMResult) -> list[tuple[str, str, dict[str, Any]]]:
    tool_calls = []
    for prompt_message in llm_result.message.tool_calls:
        args = {}
        if prompt_message.function.arguments != "":
            try:
                args = json.loads(prompt_message.function.arguments)
            except json.JSONDecodeError as e:
                logger.error(f"JSONDecodeError: {e} - Arguments: {prompt_message.function.arguments}")
                # Handle the error or re-raise
        tool_calls.append(
            (
                prompt_message.id,
                prompt_message.function.name,
                args,
            )
        )
    return tool_calls

Additionally, ensure that when converting tool calls to JSON, you handle potential encoding issues by using ensure_ascii=False in json.dumps:

tool_call_inputs = json.dumps(
    {tool_call[1]: tool_call[2] for tool_call in tool_calls},
    ensure_ascii=False,
)

By adding these logging statements and ensuring proper JSON encoding, you can capture the exact JSON data causing the JSONDecodeError, which will help you diagnose and fix the issue [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 1, 2025): <!-- Greeting --> Hello @planwk! I'm here to help you with bugs, questions, and becoming a contributor. Feel free to ask anything you need assistance with while waiting for a human maintainer. <!-- Answer --> To solve the `JSONDecodeError` you're encountering with the function calling strategy in your self-hosted Dify agent, ensure that the JSON data being processed is correctly formatted. This error typically occurs when the JSON data is not properly structured. You can add logging to capture the problematic JSON data before attempting to decode it, which will help you track more detailed information about the error. Here's how you can modify your code to include logging for debugging purposes: ```python import json import logging logger = logging.getLogger(__name__) # In the extract_tool_calls method def extract_tool_calls(self, llm_result_chunk: LLMResultChunk) -> list[tuple[str, str, dict[str, Any]]]: tool_calls = [] for prompt_message in llm_result_chunk.delta.message.tool_calls: args = {} if prompt_message.function.arguments != "": try: args = json.loads(prompt_message.function.arguments) except json.JSONDecodeError as e: logger.error(f"JSONDecodeError: {e} - Arguments: {prompt_message.function.arguments}") # Handle the error or re-raise tool_calls.append( ( prompt_message.id, prompt_message.function.name, args, ) ) return tool_calls # In the extract_blocking_tool_calls method def extract_blocking_tool_calls(self, llm_result: LLMResult) -> list[tuple[str, str, dict[str, Any]]]: tool_calls = [] for prompt_message in llm_result.message.tool_calls: args = {} if prompt_message.function.arguments != "": try: args = json.loads(prompt_message.function.arguments) except json.JSONDecodeError as e: logger.error(f"JSONDecodeError: {e} - Arguments: {prompt_message.function.arguments}") # Handle the error or re-raise tool_calls.append( ( prompt_message.id, prompt_message.function.name, args, ) ) return tool_calls ``` Additionally, ensure that when converting tool calls to JSON, you handle potential encoding issues by using `ensure_ascii=False` in `json.dumps`: ```python tool_call_inputs = json.dumps( {tool_call[1]: tool_call[2] for tool_call in tool_calls}, ensure_ascii=False, ) ``` By adding these logging statements and ensuring proper JSON encoding, you can capture the exact JSON data causing the `JSONDecodeError`, which will help you diagnose and fix the issue <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/agent/fc_agent_runner.py)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/plugins/quick-start/develop-plugins/agent-strategy-plugin.md)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/0b577511-dcb5-4763-b59e-04d59f016f03?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/0b577511-dcb5-4763-b59e-04d59f016f03?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/0b577511-dcb5-4763-b59e-04d59f016f03?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/0b577511-dcb5-4763-b59e-04d59f016f03?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0b577511-dcb5-4763-b59e-04d59f016f03?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/0b577511-dcb5-4763-b59e-04d59f016f03?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0b577511-dcb5-4763-b59e-04d59f016f03?feedback_type=other)</sup>
Author
Owner

@planwk commented on GitHub (Apr 1, 2025):

Where should I add these codes? I'm deploying with Docker.

@planwk commented on GitHub (Apr 1, 2025): Where should I add these codes? I'm deploying with Docker.
Author
Owner

@planwk commented on GitHub (Apr 2, 2025):

@dosu Where should I add these codes? I'm deploying with Docker.Where to add the agent node in dify

@planwk commented on GitHub (Apr 2, 2025): @dosu Where should I add these codes? I'm deploying with Docker.Where to add the agent node in dify
Author
Owner

@leslie2046 commented on GitHub (Apr 2, 2025):

@planwk Which model and provider do you use?Can you take a screenshot ?

@leslie2046 commented on GitHub (Apr 2, 2025): @planwk Which model and provider do you use?Can you take a screenshot ?
Author
Owner

@junjiem commented on GitHub (Apr 2, 2025):

@leslie2046 qwen-max series will have this problem

dify 1.1.3
tongyi plugin 0.0.14

Image

@junjiem commented on GitHub (Apr 2, 2025): @leslie2046 qwen-max series will have this problem dify 1.1.3 tongyi plugin 0.0.14 ![Image](https://github.com/user-attachments/assets/57051b34-8153-4ef7-adf0-fdea9d0abb3f)
Author
Owner

@planwk commented on GitHub (Apr 2, 2025):

系列会有这个问题

The qwen-plus also has this problem. But why is the agent function calling not supported by qwen2.5-72b-instruct? I can use Langchain and it is supported. Also, how can I add detailed logs for viewing in the agent?

@planwk commented on GitHub (Apr 2, 2025): > 系列会有这个问题 The qwen-plus also has this problem. But why is the agent function calling not supported by qwen2.5-72b-instruct? I can use Langchain and it is supported. Also, how can I add detailed logs for viewing in the agent?
Author
Owner

@leslie2046 commented on GitHub (Apr 2, 2025):

Image
Sometime entercounted in siliconflow qwen2.5 series.
2025-04-03 02:38:42,976 ERROR [app_generator.py:257] c4e8655810 Error when generating
Traceback (most recent call last):
File "/home/leslie/chatgpt/dify/api/core/app/apps/agent_chat/app_generator.py", line 240, in _generate_worker
runner.run(
File "/home/leslie/chatgpt/dify/api/core/app/apps/agent_chat/app_runner.py", line 245, in run
self._handle_invoke_result(
File "/home/leslie/chatgpt/dify/api/core/app/apps/base_app_runner.py", line 278, in _handle_invoke_result
self._handle_invoke_result_stream(invoke_result=invoke_result, queue_manager=queue_manager, agent=agent)
File "/home/leslie/chatgpt/dify/api/core/app/apps/base_app_runner.py", line 313, in _handle_invoke_result_stream
for result in invoke_result:
^^^^^^^^^^^^^
File "/home/leslie/chatgpt/dify/api/core/agent/fc_agent_runner.py", line 123, in run
tool_calls.extend(self.extract_tool_calls(chunk) or [])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leslie/chatgpt/dify/api/core/agent/fc_agent_runner.py", line 344, in extract_tool_calls
args = json.loads(prompt_message.function.arguments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leslie/anaconda3/envs/dify/lib/python3.12/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leslie/anaconda3/envs/dify/lib/python3.12/json/decoder.py", line 341, in decode
raise JSONDecodeError("Extra data", s, end)
json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3)
2025-04-03 02:38:42,978 DEBUG [based_generate_task_pipeline.py:45] ed092e634b error: Extra data: line 1 column 4 (char 3)

@leslie2046 commented on GitHub (Apr 2, 2025): ![Image](https://github.com/user-attachments/assets/5bf127dd-d0b8-4e49-a979-24766e25ab59) Sometime entercounted in siliconflow qwen2.5 series. 2025-04-03 02:38:42,976 ERROR [app_generator.py:257] c4e8655810 Error when generating Traceback (most recent call last): File "/home/leslie/chatgpt/dify/api/core/app/apps/agent_chat/app_generator.py", line 240, in _generate_worker runner.run( File "/home/leslie/chatgpt/dify/api/core/app/apps/agent_chat/app_runner.py", line 245, in run self._handle_invoke_result( File "/home/leslie/chatgpt/dify/api/core/app/apps/base_app_runner.py", line 278, in _handle_invoke_result self._handle_invoke_result_stream(invoke_result=invoke_result, queue_manager=queue_manager, agent=agent) File "/home/leslie/chatgpt/dify/api/core/app/apps/base_app_runner.py", line 313, in _handle_invoke_result_stream for result in invoke_result: ^^^^^^^^^^^^^ File "/home/leslie/chatgpt/dify/api/core/agent/fc_agent_runner.py", line 123, in run tool_calls.extend(self.extract_tool_calls(chunk) or []) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/leslie/chatgpt/dify/api/core/agent/fc_agent_runner.py", line 344, in extract_tool_calls args = json.loads(prompt_message.function.arguments) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/leslie/anaconda3/envs/dify/lib/python3.12/json/__init__.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/leslie/anaconda3/envs/dify/lib/python3.12/json/decoder.py", line 341, in decode raise JSONDecodeError("Extra data", s, end) json.decoder.JSONDecodeError: Extra data: line 1 column 4 (char 3) 2025-04-03 02:38:42,978 DEBUG [based_generate_task_pipeline.py:45] ed092e634b error: Extra data: line 1 column 4 (char 3)
Author
Owner

@planwk commented on GitHub (Apr 2, 2025):

Here, we cannot obtain the online version of qwen2.5-72b-instruct. We can only choose qwen-plus or qwen-max, and both of them have this problem.

Image

Image

@planwk commented on GitHub (Apr 2, 2025): Here, we cannot obtain the online version of qwen2.5-72b-instruct. We can only choose qwen-plus or qwen-max, and both of them have this problem. ![Image](https://github.com/user-attachments/assets/1c465e46-973a-4f99-9071-9796ceebddeb) ![Image](https://github.com/user-attachments/assets/639b0972-c2b2-45ce-bf22-0b737034c344)
Author
Owner

@planwk commented on GitHub (Apr 2, 2025):

Image Sometime entercounted in siliconflow qwen2.5 series.

It's 72b.

@planwk commented on GitHub (Apr 2, 2025): > ![Image](https://github.com/user-attachments/assets/5bf127dd-d0b8-4e49-a979-24766e25ab59) Sometime entercounted in siliconflow qwen2.5 series. It's 72b.
Author
Owner

@leslie2046 commented on GitHub (Apr 2, 2025):

https://github.com/langgenius/dify-official-plugins/blob/main/models/tongyi/models/llm/qwen2.5-72b-instruct.yaml#L7
@planwk should add 2 features

  • multi-tool-call
  • stream-tool-call

Here, we cannot obtain the online version of qwen2.5-72b-instruct. We can only choose qwen-plus or qwen-max, and both of them have this problem.

Image

Image

@leslie2046 commented on GitHub (Apr 2, 2025): https://github.com/langgenius/dify-official-plugins/blob/main/models/tongyi/models/llm/qwen2.5-72b-instruct.yaml#L7 @planwk should add 2 features - multi-tool-call - stream-tool-call > Here, we cannot obtain the online version of qwen2.5-72b-instruct. We can only choose qwen-plus or qwen-max, and both of them have this problem. > > ![Image](https://github.com/user-attachments/assets/1c465e46-973a-4f99-9071-9796ceebddeb) > > ![Image](https://github.com/user-attachments/assets/639b0972-c2b2-45ce-bf22-0b737034c344)
Author
Owner

@junjiem commented on GitHub (Apr 2, 2025):

Image
my env, no problem with qwen2.5-72b, only qwen-max has problem

@junjiem commented on GitHub (Apr 2, 2025): ![Image](https://github.com/user-attachments/assets/db3dd612-4313-4473-9d21-54ef4c24a93a) my env, no problem with qwen2.5-72b, only qwen-max has problem
Author
Owner

@planwk commented on GitHub (Apr 2, 2025):

https://github.com/langgenius/dify-official-plugins/blob/main/models/tongyi/models/llm/qwen2.5-72b-instruct.yaml#L7 @planwk应该添加 2 个功能

  • 多工具调用
  • 流工具调用

这里无法获取到qwen2.5-72b-instruct的在线版本,只能选择qwen-plus或者qwen-max,都存在这个问题。
Image
Image

How should I proceed with the modification? Should I re-download the plugin and install it offline, or modify the configuration?

@planwk commented on GitHub (Apr 2, 2025): > https://github.com/langgenius/dify-official-plugins/blob/main/models/tongyi/models/llm/qwen2.5-72b-instruct.yaml#L7 [@planwk](https://github.com/planwk)应该添加 2 个功能 > > * 多工具调用 > * 流工具调用 > > > 这里无法获取到qwen2.5-72b-instruct的在线版本,只能选择qwen-plus或者qwen-max,都存在这个问题。 > > ![Image](https://github.com/user-attachments/assets/1c465e46-973a-4f99-9071-9796ceebddeb) > > ![Image](https://github.com/user-attachments/assets/639b0972-c2b2-45ce-bf22-0b737034c344) How should I proceed with the modification? Should I re-download the plugin and install it offline, or modify the configuration?
Author
Owner

@planwk commented on GitHub (Apr 2, 2025):

Image
Is that so?Still not working.

@planwk commented on GitHub (Apr 2, 2025): ![Image](https://github.com/user-attachments/assets/753d9de7-5820-4981-9957-6c706c3d4744) Is that so?Still not working.
Author
Owner

@planwk commented on GitHub (Apr 2, 2025):

@leslie2046 Still not working.

@planwk commented on GitHub (Apr 2, 2025): @leslie2046 Still not working.
Author
Owner

@leslie2046 commented on GitHub (Apr 3, 2025):

Image Is that so?Still not working.
do not delete

  • agent-thought
@leslie2046 commented on GitHub (Apr 3, 2025): > ![Image](https://github.com/user-attachments/assets/753d9de7-5820-4981-9957-6c706c3d4744) Is that so?Still not working. do not delete - agent-thought
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

Image Is that so?Still not working.
do not delete

  • agent-thought

Later on, I made some changes, but it still doesn't show up.

Image

@planwk commented on GitHub (Apr 3, 2025): > > ![Image](https://github.com/user-attachments/assets/753d9de7-5820-4981-9957-6c706c3d4744) Is that so?Still not working. > > do not delete > > * agent-thought Later on, I made some changes, but it still doesn't show up. ![Image](https://github.com/user-attachments/assets/d2f17fc5-ab23-4402-b6e4-317ab4eebca6)
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

@leslie2046

@planwk commented on GitHub (Apr 3, 2025): @leslie2046
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

@junjiem Could you please tell me how to select Qwen2.5-72b for the agent in Chatflow? I'm deploying it via Docker.

@planwk commented on GitHub (Apr 3, 2025): @junjiem Could you please tell me how to select Qwen2.5-72b for the agent in Chatflow? I'm deploying it via Docker.
Author
Owner

@junjiem commented on GitHub (Apr 3, 2025):

@junjiem Could you please tell me how to select Qwen2.5-72b for the agent in Chatflow? I'm deploying it via Docker.请告诉我如何在 Chatflow 中为代理选择 Qwen2.5-72b?我正通过 Docker 进行部署。

your tongyi plugin version?

@junjiem commented on GitHub (Apr 3, 2025): > [@junjiem](https://github.com/junjiem) Could you please tell me how to select Qwen2.5-72b for the agent in Chatflow? I'm deploying it via Docker.请告诉我如何在 Chatflow 中为代理选择 Qwen2.5-72b?我正通过 Docker 进行部署。 your tongyi plugin version?
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

your tongyi plugin version?

0.0.14

@planwk commented on GitHub (Apr 3, 2025): > your tongyi plugin version? 0.0.14
Author
Owner

@junjiem commented on GitHub (Apr 3, 2025):

your tongyi plugin version?

0.0.14

That's strange. Have you changed the source code?

@junjiem commented on GitHub (Apr 3, 2025): > > your tongyi plugin version? > > 0.0.14 That's strange. Have you changed the source code?
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

That's strange. Have you changed the source code?
I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.

@planwk commented on GitHub (Apr 3, 2025): > That's strange. Have you changed the source code? I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.
Author
Owner

@junjiem commented on GitHub (Apr 3, 2025):

@leslie2046 qwen-max series will have this problem

dify 1.1.3 tongyi plugin 0.0.14

Image

Just released 0.0.15, I upgraded and found the problem disappeared.

Image

It should be that the dependency version is too old, and the only relevant thing in 0.0.15 is that the dependency package is upgraded here.

@junjiem commented on GitHub (Apr 3, 2025): > [@leslie2046](https://github.com/leslie2046) qwen-max series will have this problem > > dify 1.1.3 tongyi plugin 0.0.14 > > ![Image](https://github.com/user-attachments/assets/57051b34-8153-4ef7-adf0-fdea9d0abb3f) Just released 0.0.15, I upgraded and found the problem disappeared. ![Image](https://github.com/user-attachments/assets/b1c95642-546b-4ac9-90f3-20ac256ab8e5) It should be that the dependency version is too old, and the only relevant thing in 0.0.15 is that the dependency package is upgraded here.
Author
Owner

@junjiem commented on GitHub (Apr 3, 2025):

That's strange. Have you changed the source code?
I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.

I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.

@junjiem commented on GitHub (Apr 3, 2025): > > That's strange. Have you changed the source code? > > I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available. I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

That's strange. Have you changed the source code?
I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.

I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.

Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application.
The above contains screenshots based on the Qwen2.5-72b agent

@planwk commented on GitHub (Apr 3, 2025): > > > That's strange. Have you changed the source code? > > > I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available. > > I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling. Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent
Author
Owner

@junjiem commented on GitHub (Apr 3, 2025):

That's strange. Have you changed the source code?
I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.

I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.

Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent

I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct.

Image

Image

@junjiem commented on GitHub (Apr 3, 2025): > > > > That's strange. Have you changed the source code? > > > > I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available. > > > > > > I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling. > > Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct. ![Image](https://github.com/user-attachments/assets/3aacbce1-2874-4265-afd1-b3a719034806) ![Image](https://github.com/user-attachments/assets/ddcb63db-66e1-41b8-b0ec-aa4208efde2a)
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

That's strange. Have you changed the source code?这是奇怪的。您是否更改了源代码?
I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.我正在部署Docker。在Chatflow中,不能选择代理,但代理应用程序可用。

I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.我知道你的问题。Chatflow Agent由于选择了函数调用策略,所以不能选择Qwen2.5-72b。Qwen2.5-72b不支持函数调用。

Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent我用的是Langchain,它支持函数调用。此外,还可以在代理应用程序中调用工具。以上为基于Qwen2.5-72b代理的截图

I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct.我可能没有正确地描述这个问题。但Qwen2.5-72b不支持函数调用。代理应用程序qwen2.5-72b使用ReAct。

Image

Image

Image
This should also be a function call, right?

@planwk commented on GitHub (Apr 3, 2025): > > > > > That's strange. Have you changed the source code?这是奇怪的。您是否更改了源代码? > > > > > I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.我正在部署Docker。在Chatflow中,不能选择代理,但代理应用程序可用。 > > > > > > > > > I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.我知道你的问题。Chatflow Agent由于选择了函数调用策略,所以不能选择Qwen2.5-72b。Qwen2.5-72b不支持函数调用。 > > > > > > Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent我用的是Langchain,它支持函数调用。此外,还可以在代理应用程序中调用工具。以上为基于Qwen2.5-72b代理的截图 > > I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct.我可能没有正确地描述这个问题。但Qwen2.5-72b不支持函数调用。代理应用程序qwen2.5-72b使用ReAct。 > > ![Image](https://github.com/user-attachments/assets/3aacbce1-2874-4265-afd1-b3a719034806) > > ![Image](https://github.com/user-attachments/assets/ddcb63db-66e1-41b8-b0ec-aa4208efde2a) ![Image](https://github.com/user-attachments/assets/f4e413a9-5a8a-4340-b746-d9618d1d2b08) This should also be a function call, right?
Author
Owner

@junjiem commented on GitHub (Apr 3, 2025):

That's strange. Have you changed the source code?这是奇怪的。您是否更改了源代码?
I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.我正在部署Docker。在Chatflow中,不能选择代理,但代理应用程序可用。

I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.我知道你的问题。Chatflow Agent由于选择了函数调用策略,所以不能选择Qwen2.5-72b。Qwen2.5-72b不支持函数调用。

Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent我用的是Langchain,它支持函数调用。此外,还可以在代理应用程序中调用工具。以上为基于Qwen2.5-72b代理的截图

I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct.我可能没有正确地描述这个问题。但Qwen2.5-72b不支持函数调用。代理应用程序qwen2.5-72b使用ReAct。
Image
Image

Image This should also be a function call, right?

You need to learn the differences and similarities between ReAct and Function Calling. I put together a picture for you to look at

Image

@junjiem commented on GitHub (Apr 3, 2025): > > > > > > That's strange. Have you changed the source code?这是奇怪的。您是否更改了源代码? > > > > > > I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.我正在部署Docker。在Chatflow中,不能选择代理,但代理应用程序可用。 > > > > > > > > > > > > I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.我知道你的问题。Chatflow Agent由于选择了函数调用策略,所以不能选择Qwen2.5-72b。Qwen2.5-72b不支持函数调用。 > > > > > > > > > Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent我用的是Langchain,它支持函数调用。此外,还可以在代理应用程序中调用工具。以上为基于Qwen2.5-72b代理的截图 > > > > > > I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct.我可能没有正确地描述这个问题。但Qwen2.5-72b不支持函数调用。代理应用程序qwen2.5-72b使用ReAct。 > > ![Image](https://github.com/user-attachments/assets/3aacbce1-2874-4265-afd1-b3a719034806) > > ![Image](https://github.com/user-attachments/assets/ddcb63db-66e1-41b8-b0ec-aa4208efde2a) > > ![Image](https://github.com/user-attachments/assets/f4e413a9-5a8a-4340-b746-d9618d1d2b08) This should also be a function call, right? You need to learn the differences and similarities between ReAct and Function Calling. I put together a picture for you to look at ![Image](https://github.com/user-attachments/assets/db39eb12-934f-4761-bfa6-7078cd2a5136)
Author
Owner

@planwk commented on GitHub (Apr 3, 2025):

OK. Thank you.But I can do it with the function calling feature of the Langchain framework.

@planwk commented on GitHub (Apr 3, 2025): OK. Thank you.But I can do it with the function calling feature of the Langchain framework.
Author
Owner

@ChronosLiu commented on GitHub (Apr 4, 2025):

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

Image

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.

Refer to the log details in the issue I mentioned
https://github.com/langgenius/dify-official-plugins/issues/616

@ChronosLiu commented on GitHub (Apr 4, 2025): ``` response = Generation.call( **params, result_format="message", stream=stream, incremental_output=False if tools else stream, ) ``` ![Image](https://github.com/user-attachments/assets/cc99822f-d09e-4cc0-bddd-de5cf89c375d) 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. Refer to the log details in the issue I mentioned https://github.com/langgenius/dify-official-plugins/issues/616
Author
Owner

@Korayem commented on GitHub (Jul 14, 2025):

@junjiem
How can i change an Agent Strategy? I notice it defaults to Function Calling and UI doesnt allow me to change it to ReAct

Image

That's strange. Have you changed the source code?这是奇怪的。您是否更改了源代码?
I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.我正在部署Docker。在Chatflow中,不能选择代理,但代理应用程序可用。

I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.我知道你的问题。Chatflow Agent由于选择了函数调用策略,所以不能选择Qwen2.5-72b。Qwen2.5-72b不支持函数调用。

Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent我用的是Langchain,它支持函数调用。此外,还可以在代理应用程序中调用工具。以上为基于Qwen2.5-72b代理的截图

I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct.我可能没有正确地描述这个问题。但Qwen2.5-72b不支持函数调用。代理应用程序qwen2.5-72b使用ReAct。
Image
Image

Image This should also be a function call, right?

You need to learn the differences and similarities between ReAct and Function Calling. I put together a picture for you to look at

Image

@Korayem commented on GitHub (Jul 14, 2025): @junjiem How can i change an Agent Strategy? I notice it defaults to Function Calling and UI doesnt allow me to change it to ReAct <img width="619" height="215" alt="Image" src="https://github.com/user-attachments/assets/daa747d9-6e51-45ce-8b80-16e5743bc8ec" /> > > > > > > > That's strange. Have you changed the source code?这是奇怪的。您是否更改了源代码? > > > > > > > I am deploying with Docker.In Chatflow, the agent cannot be selected, but the agent application is available.我正在部署Docker。在Chatflow中,不能选择代理,但代理应用程序可用。 > > > > > > > > > > > > > > > I'm aware of your problem. Chatflow Agent You have selected the Function Calling strategy so Qwen2.5-72b cannot be selected. Qwen2.5-72b does not support Function Calling.我知道你的问题。Chatflow Agent由于选择了函数调用策略,所以不能选择Qwen2.5-72b。Qwen2.5-72b不支持函数调用。 > > > > > > > > > > > > Qwen2.5-72b I'm using Langchain and it supports Function Calling. Moreover, tools can also be invoked within the agent application. The above contains screenshots based on the Qwen2.5-72b agent我用的是Langchain,它支持函数调用。此外,还可以在代理应用程序中调用工具。以上为基于Qwen2.5-72b代理的截图 > > > > > > > > > I may not have described the problem correctly. but Qwen2.5-72b does not support Function Calling. Agent application qwen2.5-72b is use ReAct.我可能没有正确地描述这个问题。但Qwen2.5-72b不支持函数调用。代理应用程序qwen2.5-72b使用ReAct。 > > > ![Image](https://github.com/user-attachments/assets/3aacbce1-2874-4265-afd1-b3a719034806) > > > ![Image](https://github.com/user-attachments/assets/ddcb63db-66e1-41b8-b0ec-aa4208efde2a) > > > > > > ![Image](https://github.com/user-attachments/assets/f4e413a9-5a8a-4340-b746-d9618d1d2b08) This should also be a function call, right? > > You need to learn the differences and similarities between ReAct and Function Calling. I put together a picture for you to look at > > ![Image](https://github.com/user-attachments/assets/db39eb12-934f-4761-bfa6-7078cd2a5136)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#160