dify icon indicating copy to clipboard operation
dify copied to clipboard

Parameter Extractor not working (Query not found)

Open AndyMik90 opened this issue 1 year ago • 4 comments

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.6.11

Cloud or Self Hosted

Cloud

Steps to reproduce

CleanShot 2024-06-25 at 12 00 34

Use the Paramater Extractor

✔️ Expected Behavior

Worked in previous versions

❌ Actual Behavior

Gives now has the error "Node Parameter Extractor run failed: Query not found"

AndyMik90 avatar Jun 25 '24 10:06 AndyMik90

@takatost maybe related to the commit https://github.com/langgenius/dify/commit/4a031de0d9932aa0dde354fad47b4dbbfbe9d79a ?

AndyMik90 avatar Jun 25 '24 10:06 AndyMik90

The "Query not found" error in the Parameter Extractor for version 0.6.11 occurs when the query variable is not found in the variable_pool. This issue is raised in the following code snippet:

query = variable_pool.get_variable_value(node_data.query)
if not query:
    raise ValueError("Query not found")

This indicates that if the query is not present in the variable_pool, a ValueError with the message "Query not found" will be raised [1].

The commit "4a031de" by "takatost" on June 24, 2024, introduced changes to the variable_pool handling, specifically fetching the query and memory from the variable_pool:

  1. Fetching Query from variable_pool:

    query = variable_pool.get_variable_value(node_data.query)
    if not query:
        raise ValueError("Query not found")
    
  2. Fetching Memory from variable_pool:

    memory = self._fetch_memory(node_data.memory, variable_pool, model_instance)
    

These changes ensure that the query and memory are dynamically fetched from the variable_pool during the node's execution, which might be causing the issue if the query is not correctly set in the variable_pool [1].

To resolve this issue, ensure that the query variable is correctly set in the variable_pool before the Parameter Extractor node is executed.

@takatost, this seems to be a complex issue that could benefit from your expertise.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Jun 25 '24 10:06 dosubot[bot]

This error message is a bit misleading, it's actually checking the content of the Input variable configured. Could you please check if there is a value for this Input variable in the Log?

takatost avatar Jun 25 '24 10:06 takatost

I see. Somebody decided that this was a good change. There is no way to use the information from the Google search tool downstream, as it only outputs text. CleanShot 2024-06-25 at 17 37 03

AndyMik90 avatar Jun 25 '24 15:06 AndyMik90