Closed onlywangyh closed 9 months ago
🤖
Hey there, @onlywangyh! Great to see you reaching out again. Hope you're doing well!
Based on the error message you provided, it seems like the issue is related to the "weather" parameter not being provided in the input form. This could be due to a variety of reasons, such as the parameter not existing in the API schema, the parameter being duplicated, the parameter being required but not provided, or the parameter not having a default value and no value being provided.
To troubleshoot this issue, you could check the following:
Ensure that the "weather" parameter exists in the API schema. The parser checks for parameters in the 'parameters' field of the operation object (interface['operation']['parameters']). If the "weather" parameter is not listed there, it will not be recognized and could result in an "invalid_param" error.
Check if the "weather" parameter is duplicated. The parser checks for duplicate parameters and raises a warning if it finds any ('Parameter {name} is duplicated.'). If the API or the tool you're using does not handle duplicate parameters correctly, this could result in an "invalid_param" error.
Verify if the "weather" parameter is required but not provided. The parser checks if a parameter is required (parameter.get('required', False)). If a required parameter like "weather" is not provided, this could result in an "invalid_param" error.
Check if the "weather" parameter does not have a default value and no value is provided. The parser checks if a parameter has a default value (parameter['default'] if 'default' in parameter else None). If a parameter like "weather" does not have a default value and no value is provided, this could result in an "invalid_param" error.
You can find more information about the parser in the parser.py file.
If you're still encountering issues after checking these possibilities, could you please provide more specific information about the "weather" parameter and the API schema? This would help in providing a more precise solution.
fixed. #2490
Self Checks
Dify version
0.5.5
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I used the API-based variable feature, but it is not working. It only supports text paragraphs and dropdown options. The code based on local development cannot implement the loading of variable functions.
✔️ Expected Behavior
The weather plugin is working normally.
❌ Actual Behavior
I got the wrong response { "code": "invalid_param", "message": "weather is required in input form", "status": 400 }