Closed BingGo-1 closed 1 week ago
Hey there, @BingGo-1! 👋 I'm here to help you with bugs, questions, and even how to become a contributor. Let's squash those bugs together!
To address the issue where the Parameter Extraction node in Dify version 0.6.13 fails to extract parameters when memory is enabled, ensure that the memory feature is properly configured. Here are the steps to follow:
Advanced Settings:
Memory:
When memory is enabled, each input to the question classifier will include the chat history in the conversation to help the LLM understand the context and improve question comprehension during interactive dialogues. The memory is fetched using the _fetch_memory
method, which retrieves the chat history and includes it in the prompt messages.
Output Variables:
__is_success Number
: Indicates whether the extraction was successful (1 for success, 0 for failure).__reason String
: Provides the reason for extraction failure, if any.Implementation Details:
ParameterExtractorNode
class handles the parameter extraction process._run
method executes the node, fetching the query and memory, and invoking the LLM._invoke_llm
method sends the prompt messages to the LLM and processes the response._generate_function_call_prompt
and _generate_prompt_engineering_prompt
methods create the prompts for the LLM, incorporating the chat history if memory is enabled._validate_result
and _transform_result
methods ensure the extracted parameters are valid and in the correct format.By following these steps and ensuring that memory is enabled, the Parameter Extraction node should be able to correctly extract parameters in a multi-turn conversation. This configuration will help the LLM to utilize the context from previous interactions, thereby improving the accuracy of parameter extraction in multi-turn conversations [1][2][3].
To continue talking to Dosu, mention @dosu.
Self Checks
Dify version
0.6.13
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
I am using chatflow to build a application. I want to extract some parameters for next step. Because of there are four parmeters, maybe user's question could lose some, so i enabled the memory of the Parameter Extraction node expecting get all the parameters through Multi-turn conversation. But in contrast , the Parameter Extraction node get nothing for the output, and i think this is a bug . I tried many times. Over all, when enable memory, the node can not get anyone of the defined parameters. And when close memory, it works fine.
✔️ Expected Behavior
I expect the Parameter Extraction node can get parameters when enabling the memory of the node.
❌ Actual Behavior
Once enable the memory, none of the parameters can be extracted. Although it works fine when close the memory, it can not get all parameters through Multi-turn conversation at this situation.