dify icon indicating copy to clipboard operation
dify copied to clipboard

Run failed: Variable #xxx not found in variable pool

Open huu3301 opened this issue 1 year ago • 2 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] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • [X] Please do not modify this template :) and fill in all the required fields.

Dify version

v0.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Set an optional input parameter. image
  2. Add a IF/ELSE block.
  3. Add a LLM Block for the if branch.
  4. Add a variable aggregator block for the LLM Block and else branch. image
  5. Add a template block. image 6.Add a LLM block and an ANSWER block. image

This is the YAML file: test.txt

✔️ Expected Behavior

Can run normally. Additionally, can I directly use the output of variable aggregator in the LLM prompt instead of using a template block?

❌ Actual Behavior

Running error in v0.10.1: 企业微信截图_17298359658659

but running normally in v0.9.2: 企业微信截图_17298358034736

huu3301 avatar Oct 25 '24 06:10 huu3301

The error "Variable image_text not found in variable pool" in version 0.10.1 likely occurs because the variable image_text is not being correctly fetched from the variable pool. This behavior might have changed between versions 0.9.2 and 0.10.1, leading to the error in the newer version [1].

Regarding your question about using the output of the variable aggregator directly in the LLM prompt, you cannot do this without using a template block. The prompt generation process involves using a prompt template and inputs, which are processed through methods that require a template block to structure the prompt correctly [1].

To continue talking to Dosu, mention @dosu.

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

This is expected behavior. The VariableAggregator is designed to select the truly completed branch among several preceding ones. In your example, VLM wasn’t executed, and the subsequent Template tried to use the output of VLM… It couldn’t access this value, which led to an error.

but running normally in v0.9.2:

That might have been unintended behavior.

Additionally, can I directly use the output of VariableAggregator in the LLM prompt instead of using a template block?

You can use all variables of types string, number, array[string], and array[number] in the LLM.

laipz8200 avatar Oct 26 '24 17:10 laipz8200

Similar issues were encountered in version 0.10.2. image dsl.txt

J2ephyr avatar Oct 29 '24 05:10 J2ephyr

Similar issues were encountered in version 0.10.2. image dsl.txt

Please check if the node where the variable you referenced is actually executed. If it hasn’t been, it’s best to use an aggregator to adjust your workflow.

laipz8200 avatar Oct 29 '24 06:10 laipz8200

Variable #1749624841670.text# not found,请问这个怎么解决?

LMJOK avatar Jun 20 '25 03:06 LMJOK