The built-in WolframAlpha gives no response #27

Closed
opened 2026-02-16 10:17:47 -05:00 by yindo · 11 comments
Owner

Originally created by @luzyPer on GitHub (Feb 27, 2025).

Originally assigned to: @crazywoola on GitHub.

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

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  • create a workflow from blank
  • add the WolframAlpha Block, set the "input" from START as the query string, output all variables "text", "files", and "json" through the END
  • run with the input: "plot 1/(1+z^2)"

✔️ Expected Behavior

return the same results as in the WolframAlpha API Explorer like:

<?xml version='1.0' encoding='UTF-8'?>




plot | 1/(1 z^2)

plot | 1/(1 z^2)</plaintext><br> </subpod><br> <expressiontypes count='1'><br> <expressiontype name='Grid' /><br> </expressiontypes><br> </pod><br> <pod title='Plots' scanner='Plot' id='Plot' position='200' error='false' numsubpods='2'><br> <subpod title=''><br> <img src='<a href="https://www6b3.wolframalpha.com/Calculate/MSP/MSP4431hicgg0d9agfcd2700003e66hgc3g31h36bf?MSPStoreType=image/gif&amp;amp;s=10" data-markdown-generated-content="">https://www6b3.wolframalpha.com/Calculate/MSP/MSP4431hicgg0d9agfcd2700003e66hgc3g31h36bf?MSPStoreType=image/gif&amp;amp;s=10</a>' alt='Plots' title='' width='421' height='216' type='2DMathPlot_1' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /><br> <plaintext></plaintext><br> </subpod><br> <subpod title=''><br> <img src='<a href="https://www6b3.wolframalpha.com/Calculate/MSP/MSP4441hicgg0d9agfcd27000061i4917gb29bg353?MSPStoreType=image/gif&amp;amp;s=10" data-markdown-generated-content="">https://www6b3.wolframalpha.com/Calculate/MSP/MSP4441hicgg0d9agfcd27000061i4917gb29bg353?MSPStoreType=image/gif&amp;amp;s=10</a>' alt='Plots' title='' width='439' height='223' type='2DMathPlot_1' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /><br> <plaintext></plaintext><br> </subpod><br> <expressiontypes count='2'><br> <expressiontype name='Default' /><br> <expressiontype name='Default' /><br> </expressiontypes><br> </pod><br> <pod title='3D plots' scanner='Plot' id='3DPlot' position='300' error='false' numsubpods='2'><br> <subpod title='Real part'><br> <img src='<a href="https://www6b3.wolframalpha.com/Calculate/MSP/MSP4451hicgg0d9agfcd2700002310b9d6901aefgi?MSPStoreType=image/gif&amp;amp;s=10" data-markdown-generated-content="">https://www6b3.wolframalpha.com/Calculate/MSP/MSP4451hicgg0d9agfcd2700002310b9d6901aefgi?MSPStoreType=image/gif&amp;amp;s=10</a>' alt='3D plots Real part' title='' width='330' height='303' type='3DMathPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /><br> <plaintext></plaintext><br> <states count='1'><br> <state name='Show contour lines' input='3DPlot__Real part_Show contour lines' /><br> </states><br> </subpod><br> <subpod title='Imaginary part'><br> <img src='<a href="https://www6b3.wolframalpha.com/Calculate/MSP/MSP4461hicgg0d9agfcd2700005ec7eg7a84ga161c?MSPStoreType=image/gif&amp;amp;s=10" data-markdown-generated-content="">https://www6b3.wolframalpha.com/Calculate/MSP/MSP4461hicgg0d9agfcd2700005ec7eg7a84ga161c?MSPStoreType=image/gif&amp;amp;s=10</a>' alt='3D plots Imaginary part' title='' width='330' height='303' type='3DMathPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /><br> <plaintext></plaintext><br> <states count='1'><br> <state name='Show contour lines' input='3DPlot__Imaginary part_Show contour lines' /><br> </states><br> </subpod><br> <expressiontypes count='2'><br> <expressiontype name='Default' /><br> <expressiontype name='Default' /><br> </expressiontypes><br> </pod><br> <pod title='Contour plots' scanner='Plot' id='ContourPlot' position='400' error='false' numsubpods='2'><br> <subpod title='Real part'><br> <img src='<a href="https://www6b3.wolframalpha.com/Calculate/MSP/MSP4471hicgg0d9agfcd2700002e135hh2097i6h1d?MSPStoreType=image/gif&amp;amp;s=10" data-markdown-generated-content="">https://www6b3.wolframalpha.com/Calculate/MSP/MSP4471hicgg0d9agfcd2700002e135hh2097i6h1d?MSPStoreType=image/gif&amp;amp;s=10</a>' alt='Contour plots Real part' title='' width='289' height='330' type='ContourPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /><br> <plaintext></plaintext><br> </subpod><br> <subpod title='Imaginary part'><br> <img src='<a href="https://www6b3.wolframalpha.com/Calculate/MSP/MSP4481hicgg0d9agfcd2700004962a3i08e8463db?MSPStoreType=image/gif&amp;amp;s=10" data-markdown-generated-content="">https://www6b3.wolframalpha.com/Calculate/MSP/MSP4481hicgg0d9agfcd2700004962a3i08e8463db?MSPStoreType=image/gif&amp;amp;s=10</a>' alt='Contour plots Imaginary part' title='' width='289' height='330' type='ContourPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /><br> <plaintext></plaintext><br> </subpod><br> <expressiontypes count='2'><br> <expressiontype name='Default' /><br> <expressiontype name='Default' /><br> </expressiontypes><br> </pod><br> <pod title='Complex map' scanner='Plot' id='ComplexMap' position='600' error='false' numsubpods='1'><br> <subpod title=''><br> <img src='<a href="https://www6b3.wolframalpha.com/Calculate/MSP/MSP4491hicgg0d9agfcd2700004ccd68295ib0820d?MSPStoreType=image/gif&amp;amp;s=10" data-markdown-generated-content="">https://www6b3.wolframalpha.com/Calculate/MSP/MSP4491hicgg0d9agfcd2700004ccd68295ib0820d?MSPStoreType=image/gif&amp;amp;s=10</a>' alt='Complex map' title='' width='215' height='96' type='2DMathPlot_1' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /><br> <plaintext></plaintext><br> </subpod><br> <expressiontypes count='1'><br> <expressiontype name='Default' /><br> </expressiontypes><br> <states count='1'><br> <state name='Larger image' input='ComplexMap__Larger image' /><br> </states><br> </pod><br> </queryresult></p> <h3><span data-attr-class="8JalTBlucqe-aP7L:emoji" aria-label="cross mark">❌</span> Actual Behavior</h3> <p dir="auto">FAIL</p> <p dir="auto">Failed to invoke tool: Failed to invoke tool</p> <p dir="auto">I also set up an agent with the WolframAlpha tool and tried different models. Unfortunately, none produce results.</p> <p dir="auto">I have authorized the WolframAlpha tool with a full results API appid.</p> </body></html>
Originally created by @luzyPer on GitHub (Feb 27, 2025). Originally assigned to: @crazywoola on GitHub. ### 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 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce - create a workflow from blank - add the WolframAlpha Block, set the "input" from START as the query string, output all variables "text", "files", and "json" through the END - run with the input: "plot 1/(1+z^2)" ### ✔️ Expected Behavior return the same results as in the WolframAlpha API Explorer like: <?xml version='1.0' encoding='UTF-8'?> <queryresult success='true' error='false' xml:space='preserve' numpods='5' datatypes='Plot' timedout='' timedoutpods='' timing='3.737' parsetiming='0.271' parsetimedout='false' recalculate='' id='MSP4401hicgg0d9agfcd270000564cha6i7g5cf33b' host='https://www6b3.wolframalpha.com' server='10' related='https://www6b3.wolframalpha.com/api/v1/relatedQueries.jsp?id=MSPa4411hicgg0d9agfcd2700003a823cb6d8ee07df3142019838491228908' version='2.6' inputstring='plot 1/(1 z^2)'> <pod title='Input interpretation' scanner='Identity' id='Input' position='100' error='false' numsubpods='1'> <subpod title=''> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4421hicgg0d9agfcd2700000i8chga9i12ce8d4?MSPStoreType=image/gif&amp;s=10' alt='plot | 1/(1 z^2)' title='plot | 1/(1 z^2)' width='114' height='56' type='Grid' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext>plot | 1/(1 z^2)</plaintext> </subpod> <expressiontypes count='1'> <expressiontype name='Grid' /> </expressiontypes> </pod> <pod title='Plots' scanner='Plot' id='Plot' position='200' error='false' numsubpods='2'> <subpod title=''> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4431hicgg0d9agfcd2700003e66hgc3g31h36bf?MSPStoreType=image/gif&amp;s=10' alt='Plots' title='' width='421' height='216' type='2DMathPlot_1' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext></plaintext> </subpod> <subpod title=''> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4441hicgg0d9agfcd27000061i4917gb29bg353?MSPStoreType=image/gif&amp;s=10' alt='Plots' title='' width='439' height='223' type='2DMathPlot_1' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext></plaintext> </subpod> <expressiontypes count='2'> <expressiontype name='Default' /> <expressiontype name='Default' /> </expressiontypes> </pod> <pod title='3D plots' scanner='Plot' id='3DPlot' position='300' error='false' numsubpods='2'> <subpod title='Real part'> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4451hicgg0d9agfcd2700002310b9d6901aefgi?MSPStoreType=image/gif&amp;s=10' alt='3D plots Real part' title='' width='330' height='303' type='3DMathPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext></plaintext> <states count='1'> <state name='Show contour lines' input='3DPlot__Real part_Show contour lines' /> </states> </subpod> <subpod title='Imaginary part'> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4461hicgg0d9agfcd2700005ec7eg7a84ga161c?MSPStoreType=image/gif&amp;s=10' alt='3D plots Imaginary part' title='' width='330' height='303' type='3DMathPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext></plaintext> <states count='1'> <state name='Show contour lines' input='3DPlot__Imaginary part_Show contour lines' /> </states> </subpod> <expressiontypes count='2'> <expressiontype name='Default' /> <expressiontype name='Default' /> </expressiontypes> </pod> <pod title='Contour plots' scanner='Plot' id='ContourPlot' position='400' error='false' numsubpods='2'> <subpod title='Real part'> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4471hicgg0d9agfcd2700002e135hh2097i6h1d?MSPStoreType=image/gif&amp;s=10' alt='Contour plots Real part' title='' width='289' height='330' type='ContourPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext></plaintext> </subpod> <subpod title='Imaginary part'> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4481hicgg0d9agfcd2700004962a3i08e8463db?MSPStoreType=image/gif&amp;s=10' alt='Contour plots Imaginary part' title='' width='289' height='330' type='ContourPlot' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext></plaintext> </subpod> <expressiontypes count='2'> <expressiontype name='Default' /> <expressiontype name='Default' /> </expressiontypes> </pod> <pod title='Complex map' scanner='Plot' id='ComplexMap' position='600' error='false' numsubpods='1'> <subpod title=''> <img src='https://www6b3.wolframalpha.com/Calculate/MSP/MSP4491hicgg0d9agfcd2700004ccd68295ib0820d?MSPStoreType=image/gif&amp;s=10' alt='Complex map' title='' width='215' height='96' type='2DMathPlot_1' themes='1,2,3,4,5,6,7,8,9,10,11,12' colorinvertable='true' contenttype='image/gif' /> <plaintext></plaintext> </subpod> <expressiontypes count='1'> <expressiontype name='Default' /> </expressiontypes> <states count='1'> <state name='Larger image' input='ComplexMap__Larger image' /> </states> </pod> </queryresult> ### ❌ Actual Behavior FAIL Failed to invoke tool: Failed to invoke tool I also set up an agent with the WolframAlpha tool and tried different models. Unfortunately, none produce results. I have authorized the WolframAlpha tool with a full results API appid.
yindo closed this issue 2026-02-16 10:17:47 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 27, 2025):

Hello, @luzyPer! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. Let's tackle this issue together!

To address the issue of the WolframAlpha tool not responding in your Dify workflow, consider the following debugging steps:

  1. Check API Credentials: Ensure that the WolframAlpha API appid is correctly configured in your Dify setup. Double-check for any typos or incorrect entries.

  2. Network Configuration: Verify that your self-hosted environment (Docker) has the necessary network access to reach the WolframAlpha API. This includes checking firewall settings and ensuring that there are no network restrictions.

  3. Tool Invocation Logs: Utilize Dify's debugging and logging capabilities to trace the tool invocation failures. Look for any ToolNodeError or PluginDaemonClientSideError in the logs, which can provide insights into what might be going wrong [1][2].

  4. Workflow Configuration: Double-check the configuration of your workflow, especially the input and output settings for the WolframAlpha block. Ensure that the input is correctly formatted and that the output variables are properly defined.

  5. Test with Simple Queries: Try running simpler queries to see if the issue persists. This can help determine if the problem is with the specific query or a broader issue with the tool integration.

  6. Update and Restart: Ensure that your Dify instance is up-to-date and consider restarting the Docker containers to clear any transient issues.

If these steps do not resolve the issue, further investigation into the specific error messages and logs will be necessary to pinpoint the problem.

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 (Feb 27, 2025): <!-- Greeting --> Hello, @luzyPer! I'm here to help you with any bugs, questions, or contributions you have for the Dify project. Let's tackle this issue together! <!-- Answer --> To address the issue of the WolframAlpha tool not responding in your Dify workflow, consider the following debugging steps: 1. **Check API Credentials**: Ensure that the WolframAlpha API appid is correctly configured in your Dify setup. Double-check for any typos or incorrect entries. 2. **Network Configuration**: Verify that your self-hosted environment (Docker) has the necessary network access to reach the WolframAlpha API. This includes checking firewall settings and ensuring that there are no network restrictions. 3. **Tool Invocation Logs**: Utilize Dify's debugging and logging capabilities to trace the tool invocation failures. Look for any `ToolNodeError` or `PluginDaemonClientSideError` in the logs, which can provide insights into what might be going wrong <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/tool/tool_node.py)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/debug-and-preview/yu-lan-yu-yun-hang.md)</sup>. 4. **Workflow Configuration**: Double-check the configuration of your workflow, especially the input and output settings for the WolframAlpha block. Ensure that the input is correctly formatted and that the output variables are properly defined. 5. **Test with Simple Queries**: Try running simpler queries to see if the issue persists. This can help determine if the problem is with the specific query or a broader issue with the tool integration. 6. **Update and Restart**: Ensure that your Dify instance is up-to-date and consider restarting the Docker containers to clear any transient issues. If these steps do not resolve the issue, further investigation into the specific error messages and logs will be necessary to pinpoint the problem. <!-- 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/74cd83e5-6b5a-4736-965a-1e59f6abd0ff?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/74cd83e5-6b5a-4736-965a-1e59f6abd0ff?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/74cd83e5-6b5a-4736-965a-1e59f6abd0ff?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/74cd83e5-6b5a-4736-965a-1e59f6abd0ff?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/74cd83e5-6b5a-4736-965a-1e59f6abd0ff?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/74cd83e5-6b5a-4736-965a-1e59f6abd0ff?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/74cd83e5-6b5a-4736-965a-1e59f6abd0ff?feedback_type=other)</sup>
Author
Owner

@luzyPer commented on GitHub (Feb 27, 2025):

  • I double checked the appid, the tool shows "authorized" with a green check.
  • The network should be right. I tried to call other tools. All works.
  • The query is simple, as "plot 1/(1+z^2)"
  • I have tried to restart the docker environment. But nothing changed.

In the previous report, I mistakenly used the run history with a wrong case set. With the correct setup, I can have success run. But the results from the workflow is empty, consistent with the agent case.

Update the result. The output is:

{
"text": "No result found",
"files": [],
"json": []
}

@luzyPer commented on GitHub (Feb 27, 2025): - I double checked the appid, the tool shows "authorized" with a green check. - The network should be right. I tried to call other tools. All works. - The query is simple, as "plot 1/(1+z^2)" - I have tried to restart the docker environment. But nothing changed. In the previous report, I mistakenly used the run history with a wrong case set. With the correct setup, I can have success run. But the results from the workflow is empty, consistent with the agent case. Update the result. The output is: >{ > "text": "No result found", > "files": [], > "json": [] >}
Author
Owner

@luzyPer commented on GitHub (Mar 2, 2025):

@dosu

I upgraded to v1.0.0 following migration guide at https://docs.dify.ai/development/migration/migrate-to-v1.

Now, whenever I try to use the WolframAlpha plugin, I get the results:

STATUS: FAIL
Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for TextMessage\ntext\n Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\n For further information visit https://errors.pydantic.dev/2.8/v/string_type"}

I see the error is caused by the input. I haved tried some simplest input like, "x" and "plot y=x". The response in agent is

Request
{"wolframalpha": {"query": "plot y=x"}}
Response
{"wolframalpha": "tool invoke error: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for TextMessage\ntext\n Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\n For further information visit https://errors.pydantic.dev/2.8/v/string_type"}"}

@luzyPer commented on GitHub (Mar 2, 2025): @dosu I upgraded to v1.0.0 following migration guide at https://docs.dify.ai/development/migration/migrate-to-v1. Now, whenever I try to use the WolframAlpha plugin, I get the results: >STATUS: FAIL >Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for TextMessage\ntext\n Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\n For further information visit https://errors.pydantic.dev/2.8/v/string_type"} I see the error is caused by the input. I haved tried some simplest input like, "x" and "plot y=x". The response in agent is >Request >{"wolframalpha": {"query": "plot y=x"}} >Response >{"wolframalpha": "tool invoke error: PluginInvokeError: {\"args\":{},\"error_type\":\"ValidationError\",\"message\":\"1 validation error for TextMessage\\ntext\\n Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]\\n For further information visit https://errors.pydantic.dev/2.8/v/string_type\"}"}
Author
Owner

@dosubot[bot] commented on GitHub (Mar 2, 2025):

The "ValidationError" you're encountering suggests that the input to the WolframAlpha plugin is not being correctly formatted as a valid string. This issue might be related to changes introduced in Dify v1.0.0, which could affect how inputs are handled or validated.

Here are some steps to address this issue:

  1. Input Formatting: Ensure that the input you are sending to the WolframAlpha plugin is a properly formatted string. Double-check that the input is not None and is correctly passed as a string.

  2. Migration Guide: Review the migration guide for Dify v1.0.0 to identify any specific changes related to input handling for plugins, particularly the WolframAlpha plugin. The guide might include new requirements or changes in how inputs should be structured.

  3. Codebase Review: Check the part of the Dify codebase where input transformation for plugins is handled. Specifically, look into api/core/workflow/nodes/code/code_node.py, as this is where input transformation and validation errors can occur if the output does not meet the expected type or structure [1].

  4. Validation Rules: Ensure that the input adheres to any new validation rules that might have been introduced in the latest version. This includes checking for any constraints on input types or formats.

By following these steps, you should be able to resolve the "ValidationError" and ensure that the input to the WolframAlpha plugin is correctly formatted.

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 (Mar 2, 2025): <!-- Answer --> The "ValidationError" you're encountering suggests that the input to the WolframAlpha plugin is not being correctly formatted as a valid string. This issue might be related to changes introduced in Dify v1.0.0, which could affect how inputs are handled or validated. Here are some steps to address this issue: 1. **Input Formatting**: Ensure that the input you are sending to the WolframAlpha plugin is a properly formatted string. Double-check that the input is not `None` and is correctly passed as a string. 2. **Migration Guide**: Review the migration guide for Dify v1.0.0 to identify any specific changes related to input handling for plugins, particularly the WolframAlpha plugin. The guide might include new requirements or changes in how inputs should be structured. 3. **Codebase Review**: Check the part of the Dify codebase where input transformation for plugins is handled. Specifically, look into `api/core/workflow/nodes/code/code_node.py`, as this is where input transformation and validation errors can occur if the output does not meet the expected type or structure <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/code/code_node.py)</sup>. 4. **Validation Rules**: Ensure that the input adheres to any new validation rules that might have been introduced in the latest version. This includes checking for any constraints on input types or formats. By following these steps, you should be able to resolve the "ValidationError" and ensure that the input to the WolframAlpha plugin is correctly formatted. <!-- 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/fe2af278-5879-4603-a3b7-c20b07909162?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/fe2af278-5879-4603-a3b7-c20b07909162?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/fe2af278-5879-4603-a3b7-c20b07909162?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/fe2af278-5879-4603-a3b7-c20b07909162?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/fe2af278-5879-4603-a3b7-c20b07909162?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/fe2af278-5879-4603-a3b7-c20b07909162?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/fe2af278-5879-4603-a3b7-c20b07909162?feedback_type=other)</sup>
Author
Owner

@luzyPer commented on GitHub (Mar 3, 2025):

@dosu

I think the "ValidationError" is caused by the input format. Using "population of france" triggers the error, but following the WolframAlpha API document, "input=population%of%20france" or "population%20of%20france" do not. Instead, they produce

Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"Failed to invoke tool"}

I typed

http://api.wolframalpha.com/v2/query?appid=V***J&input=population%20of%20france

in my browser, get correct answer.

@luzyPer commented on GitHub (Mar 3, 2025): @dosu I think the "ValidationError" is caused by the input format. Using "population of france" triggers the error, but following the WolframAlpha API document, "input=population%of%20france" or "population%20of%20france" do not. Instead, they produce >Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"Failed to invoke tool"} I typed >http://api.wolframalpha.com/v2/query?appid=V***J&input=population%20of%20france in my browser, get correct answer.
Author
Owner

@dosubot[bot] commented on GitHub (Mar 3, 2025):

The "ValidationError" you're experiencing seems to be related to how the input is being formatted and passed to the WolframAlpha plugin in Dify. The discrepancy between using "population of france" and the URL-encoded versions like "population%20of%20france" suggests that the plugin might not be handling URL encoding correctly.

Here are some steps to address this:

  1. Input Encoding: Ensure that the input is correctly URL-encoded before being sent to the WolframAlpha plugin. It seems that the plugin might require inputs to be URL-encoded, similar to how you tested directly in the browser.

  2. Plugin Configuration: Check if there are any specific configuration settings in Dify for the WolframAlpha plugin that dictate how inputs should be formatted or encoded. This might be detailed in the migration guide or plugin documentation.

  3. Code Review: Review the code handling input transformation for the WolframAlpha plugin to ensure it properly encodes inputs. This might involve checking if there's a specific method responsible for URL encoding in the plugin system.

By ensuring the input is correctly formatted and encoded, you should be able to resolve the "ValidationError" and successfully invoke the WolframAlpha plugin.

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 (Mar 3, 2025): <!-- Answer --> The "ValidationError" you're experiencing seems to be related to how the input is being formatted and passed to the WolframAlpha plugin in Dify. The discrepancy between using "population of france" and the URL-encoded versions like "population%20of%20france" suggests that the plugin might not be handling URL encoding correctly. Here are some steps to address this: 1. **Input Encoding**: Ensure that the input is correctly URL-encoded before being sent to the WolframAlpha plugin. It seems that the plugin might require inputs to be URL-encoded, similar to how you tested directly in the browser. 2. **Plugin Configuration**: Check if there are any specific configuration settings in Dify for the WolframAlpha plugin that dictate how inputs should be formatted or encoded. This might be detailed in the migration guide or plugin documentation. 3. **Code Review**: Review the code handling input transformation for the WolframAlpha plugin to ensure it properly encodes inputs. This might involve checking if there's a specific method responsible for URL encoding in the plugin system. By ensuring the input is correctly formatted and encoded, you should be able to resolve the "ValidationError" and successfully invoke the WolframAlpha plugin. <!-- 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/f5b303b1-f9d8-4899-9b10-f8dd27c61b53?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f5b303b1-f9d8-4899-9b10-f8dd27c61b53?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f5b303b1-f9d8-4899-9b10-f8dd27c61b53?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f5b303b1-f9d8-4899-9b10-f8dd27c61b53?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f5b303b1-f9d8-4899-9b10-f8dd27c61b53?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/f5b303b1-f9d8-4899-9b10-f8dd27c61b53?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f5b303b1-f9d8-4899-9b10-f8dd27c61b53?feedback_type=other)</sup>
Author
Owner

@luzyPer commented on GitHub (Mar 3, 2025):

@dosu

With the URL-encoded string as input for the WolframAlpha tool, I still have the exception

Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"Failed to invoke tool"}

@luzyPer commented on GitHub (Mar 3, 2025): @dosu With the URL-encoded string as input for the WolframAlpha tool, I still have the exception >Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"Failed to invoke tool"}
Author
Owner

@dosubot[bot] commented on GitHub (Mar 3, 2025):

The "Failed to invoke tool" exception indicates that there might be an issue beyond just input formatting. Here are some steps to further investigate and potentially resolve the issue:

  1. Check Plugin Logs: Review the logs for the WolframAlpha plugin to identify any specific errors or messages that occur during the invocation. This can provide more detailed insights into what might be causing the failure.

  2. Verify API Endpoint: Ensure that the API endpoint being used by the plugin is correct and accessible. Double-check the configuration to confirm that the correct URL and parameters are being used.

  3. Network and Firewall Settings: Although you mentioned that other tools work, it's worth rechecking network settings specifically for the WolframAlpha plugin to ensure there are no restrictions or misconfigurations.

  4. Review Plugin Code: Examine the code responsible for invoking the WolframAlpha API within the Dify codebase. Look for any potential issues in how the request is constructed or sent.

  5. Test with Direct API Call: As you did before, test the API call directly in a browser or using a tool like curl to ensure that the API itself is functioning correctly with the given input.

  6. Update and Restart: Make sure your Dify instance and all related components are up-to-date. Restarting the environment can sometimes resolve transient issues.

If these steps do not resolve the issue, further investigation into the specific error messages and logs will be necessary to pinpoint the problem.

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 (Mar 3, 2025): <!-- Answer --> The "Failed to invoke tool" exception indicates that there might be an issue beyond just input formatting. Here are some steps to further investigate and potentially resolve the issue: 1. **Check Plugin Logs**: Review the logs for the WolframAlpha plugin to identify any specific errors or messages that occur during the invocation. This can provide more detailed insights into what might be causing the failure. 2. **Verify API Endpoint**: Ensure that the API endpoint being used by the plugin is correct and accessible. Double-check the configuration to confirm that the correct URL and parameters are being used. 3. **Network and Firewall Settings**: Although you mentioned that other tools work, it's worth rechecking network settings specifically for the WolframAlpha plugin to ensure there are no restrictions or misconfigurations. 4. **Review Plugin Code**: Examine the code responsible for invoking the WolframAlpha API within the Dify codebase. Look for any potential issues in how the request is constructed or sent. 5. **Test with Direct API Call**: As you did before, test the API call directly in a browser or using a tool like `curl` to ensure that the API itself is functioning correctly with the given input. 6. **Update and Restart**: Make sure your Dify instance and all related components are up-to-date. Restarting the environment can sometimes resolve transient issues. If these steps do not resolve the issue, further investigation into the specific error messages and logs will be necessary to pinpoint the problem. <!-- 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/00ff154a-a496-4e55-b516-317f3a21b2e2?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/00ff154a-a496-4e55-b516-317f3a21b2e2?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/00ff154a-a496-4e55-b516-317f3a21b2e2?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/00ff154a-a496-4e55-b516-317f3a21b2e2?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/00ff154a-a496-4e55-b516-317f3a21b2e2?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/00ff154a-a496-4e55-b516-317f3a21b2e2?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/00ff154a-a496-4e55-b516-317f3a21b2e2?feedback_type=other)</sup>
Author
Owner

@luzyPer commented on GitHub (Mar 3, 2025):

I tested on the cloud.dify.ai, using "population%20of%20france" as input, get

Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"Failed to invoke tool"}

@luzyPer commented on GitHub (Mar 3, 2025): I tested on the cloud.dify.ai, using "population%20of%20france" as input, get > Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"Exception","message":"Failed to invoke tool"}
Author
Owner

@luzyPer commented on GitHub (Mar 4, 2025):

@dosu

Following the script wolframalpha.py, I add a code block in my workflow as

import httpx
import json

def main(query: str) -> dict:
    """
    invoke WolframAlpha API
    """
    appid = "V***J"
    params = {
        "appid": appid,
        "input": query,
        "format": "plaintext",
        "output": "json"
    }
    base_url = "http://api.wolframalpha.com/v2/query"
    response = httpx.get(base_url, params=params)
    response.raise_for_status()

    return {
        "result": json.dumps(response.json())
    }

This solution meets my requirements, though it lacks comprehensive exception handling. I wonder why the WolframAlpha plugin does not work.

@luzyPer commented on GitHub (Mar 4, 2025): @dosu Following the script `wolframalpha.py`, I add a code block in my workflow as ``` import httpx import json def main(query: str) -> dict: """ invoke WolframAlpha API """ appid = "V***J" params = { "appid": appid, "input": query, "format": "plaintext", "output": "json" } base_url = "http://api.wolframalpha.com/v2/query" response = httpx.get(base_url, params=params) response.raise_for_status() return { "result": json.dumps(response.json()) } ``` This solution meets my requirements, though it lacks comprehensive exception handling. I wonder why the WolframAlpha plugin does not work.
Author
Owner

@dosubot[bot] commented on GitHub (Mar 4, 2025):

It seems like you've implemented a workaround by directly invoking the WolframAlpha API using a custom code block in your workflow. This approach bypasses the plugin and directly handles the API request, which is why it works for you.

The issue with the WolframAlpha plugin not working could be due to several factors:

  1. Plugin Configuration: There might be a misconfiguration in the plugin settings or an issue with how the plugin is set up to handle requests. Double-check the plugin's configuration to ensure everything is set correctly.

  2. Input Handling: The plugin might have specific requirements for input formatting or encoding that are not being met. Your direct API call works because you control the input format directly.

  3. Plugin Code: There could be a bug or limitation in the plugin's code that prevents it from handling certain inputs or requests correctly. Reviewing the plugin's implementation might reveal areas where it differs from your custom code.

  4. Version Compatibility: Ensure that the plugin is compatible with the version of Dify you are using. Sometimes, plugins need updates to work with newer versions of the platform.

Your custom solution is effective, but if you want to use the plugin, you might need to delve deeper into its implementation or configuration to identify the root cause of the issue.

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 (Mar 4, 2025): <!-- Answer --> It seems like you've implemented a workaround by directly invoking the WolframAlpha API using a custom code block in your workflow. This approach bypasses the plugin and directly handles the API request, which is why it works for you. The issue with the WolframAlpha plugin not working could be due to several factors: 1. **Plugin Configuration**: There might be a misconfiguration in the plugin settings or an issue with how the plugin is set up to handle requests. Double-check the plugin's configuration to ensure everything is set correctly. 2. **Input Handling**: The plugin might have specific requirements for input formatting or encoding that are not being met. Your direct API call works because you control the input format directly. 3. **Plugin Code**: There could be a bug or limitation in the plugin's code that prevents it from handling certain inputs or requests correctly. Reviewing the plugin's implementation might reveal areas where it differs from your custom code. 4. **Version Compatibility**: Ensure that the plugin is compatible with the version of Dify you are using. Sometimes, plugins need updates to work with newer versions of the platform. Your custom solution is effective, but if you want to use the plugin, you might need to delve deeper into its implementation or configuration to identify the root cause of the issue. <!-- 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/7f1d9e7a-b5b4-41a4-ac76-78394110b209?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7f1d9e7a-b5b4-41a4-ac76-78394110b209?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7f1d9e7a-b5b4-41a4-ac76-78394110b209?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7f1d9e7a-b5b4-41a4-ac76-78394110b209?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7f1d9e7a-b5b4-41a4-ac76-78394110b209?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7f1d9e7a-b5b4-41a4-ac76-78394110b209?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7f1d9e7a-b5b4-41a4-ac76-78394110b209?feedback_type=other)</sup>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#27