Chat workflow API model, the input parameters is lost when do a request!
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.3.21
Cloud or Self Hosted
Cloud, Self Hosted (Docker)
Steps to reproduce
the input parameters "gpt4o" is lost as you can see on above screenshot
✔️ Expected Behavior
I can catch the parameter of input
❌ Actual Behavior
the "inputs parameter" is lost
Hello @rnthking! I'm here to help you with bugs, questions, and becoming a contributor. Let's work together to resolve the issue you're facing.
The input parameters are likely lost when making a request to the Chat workflow API model in Dify version 0.3.21 because the inputs parameter is not being included in the data object within the runWorkflow method of the CompletionClient class.
Here is the relevant code snippet:
runWorkflow(inputs, user, stream = false, files = null) {
const data = {
inputs,
user,
response_mode: stream ? "streaming" : "blocking",
};
return this.sendRequest(
routes.runWorkflow.method,
routes.runWorkflow.url(),
data,
null,
stream
);
}
The inputs parameter is correctly included in the data object, so the issue might be elsewhere in the request handling or API endpoint. However, based on the provided code, the inputs parameter is indeed being passed in the request payload.
If the parameters are still being lost, it might be an issue with the API endpoint itself or how the server processes the request. Additionally, ensure that the createChatMessage method in the ChatClient class is correctly configured to handle the inputs parameter as specified in the ChatMessageConfig interface:
export declare class ChatClient extends DifyClient {
createChatMessage(config: ChatMessageConfig): Promise<any>;
}
Make sure that the config object passed to createChatMessage includes the inputs field properly.
Furthermore, based on the unit tests for the WorkflowConverter class, it is essential to verify that the inputs are correctly processed and converted into the appropriate nodes. For instance, in the test__convert_to_http_request_node_for_chatbot and test__convert_to_http_request_node_for_workflow_app tests, the inputs are included in the body_params of the HTTP request node:
body_params = body_data_json["params"]
assert len(body_params["inputs"]) == 3
Ensure that the WorkflowConverter correctly handles the inputs and that they are properly included in the request nodes. This might help in identifying where the inputs might be getting lost in the workflow conversion process [1][2][3].
Details
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.
@rnthking Please attach the workflow DSL file.
I updated the lastest version, the problem is solved. @junonya thx for your resp!