langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
43.08k stars 5.98k forks source link

The variable cannot be selected in the configuration box. #3624

Closed wurenxiaozu closed 2 months ago

wurenxiaozu commented 4 months ago

Self Checks

Dify version

0.6.4

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When configuring the workflow, I want to use variables in the LLM module, but I am unable to select variables in the configuration box.

https://github.com/langgenius/dify/assets/146314582/791adbdb-3b89-4eef-9821-67616ed8e57f

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

dosubot[bot] commented 4 months ago

It appears you're encountering difficulties with selecting variables in the configuration box for the LLM module in Dify version 0.6.4, specifically within a self-hosted Docker environment. This issue might stem from the process of manually configuring the LLM node, rather than a limitation or bug within the system itself.

To address this, ensure you've properly set up the model configuration under "System Settings—Model Provider" as outlined in the Dify documentation. When composing prompts within an LLM node, you should manually insert variables by using the variable insertion menu, which can be accessed by typing "/" or "{". This step is crucial for inserting variables from preceding flow nodes into the prompts as context content, enabling the desired workflow configuration.

For detailed guidance on setting up an LLM node, including the insertion of variables into prompts, refer to the Dify documentation and the example configurations found in the Dify repository.

This approach should help you overcome the issue with variable selection in the configuration box. If you continue to face difficulties or have further questions, please don't hesitate to reach out for more assistance.

Sources

#### 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. If you want to continue the conversation, start your reply with @dosu-bot.
iamjoel commented 4 months ago

@wurenxiaozu I can't reproduction this problem. Can you provide more detail to reproduction? Provide the app DSL?

wurenxiaozu commented 4 months ago

app: description: '' icon: "\U0001F916" icon_background: '#FFEAD5' mode: workflow name: "\u5546\u4E1A\u7B56\u7565AI\u63A8\u8350" workflow: features: file_upload: image: enabled: false number_limits: 3 transfer_methods:

zxhlyh commented 4 months ago

chrome?

crazywoola commented 4 months ago

@wurenxiaozu You should attach the exported file. And since you didn't use the code block to format the content. It loses it's original indentation.

chiragksharma commented 4 months ago

I sometime face the same problem.

chiragksharma commented 4 months ago

Okk I looked into this issue. The issue where touchpad clicks on the laptop are sometimes not recognized. But this problem does not occur when the user uses a mouse (because moues clicks are recognized) This issue could potentially be resolved by utilizing the onTouchStart, onTouchEnd, or onChange events in React. The code where it can be improved is mentioned below.

plugins/component-picker-block/index.tsx

<PromptMenu
                          startIndex={0}
                          selectedIndex={selectedIndex}
                          options={promptOptions}
                          onClick={(index, option) => {
                            if (option.disabled)
                              return
                            setHighlightedIndex(index)
                            selectOptionAndCleanUp(option)
                          }}
                          onMouseEnter={(index, option) => {
                            if (option.disabled)
                              return
                            setHighlightedIndex(index)
                          }}
                        />

If it is needed to be solved then let me know @crazywoola I will create a pr with the changes.

chalitbkb commented 4 months ago

@wurenxiaozu I encountered the same issue myself. I resolved it by quickly double-clicking the mouse twice in succession, which worked effectively. I'm not sure what causes this, but if you follow my method, it might retrieve the variable for you.

wurenxiaozu commented 4 months ago

Okk I looked into this issue. The issue where touchpad clicks on the laptop are sometimes not recognized. But this problem does not occur when the user uses a mouse (because moues clicks are recognized) This issue could potentially be resolved by utilizing the onTouchStart, onTouchEnd, or onChange events in React. The code where it can be improved is mentioned below.

plugins/component-picker-block/index.tsx

<PromptMenu
                          startIndex={0}
                          selectedIndex={selectedIndex}
                          options={promptOptions}
                          onClick={(index, option) => {
                            if (option.disabled)
                              return
                            setHighlightedIndex(index)
                            selectOptionAndCleanUp(option)
                          }}
                          onMouseEnter={(index, option) => {
                            if (option.disabled)
                              return
                            setHighlightedIndex(index)
                          }}
                        />

If it is needed to be solved then let me know @crazywoola I will create a pr with the changes.

Yes, this is the phenomenon. Using the mouse is fine, but using the laptop is a problem. I’m currently using the mouse and everything is normal. Previously, due to a business trip, I had to use the laptop’s touchpad.

crazywoola commented 4 months ago

@chiragksharma Thanks for the feedback and potential solution. We are welcome the PR as well :)