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
51.14k stars 7.36k forks source link

Could I use the rewritten question in LLM ? #6334

Closed fogdragon closed 3 months ago

fogdragon commented 3 months ago

Self Checks

1. Is this request related to a challenge you're experiencing? Tell me about your story.

image Why does this place have to be 'sys. query'? I have already rewritten the question due to the matching requirements of vector search, so can't I use the rewritten question in LLM ?

2. Additional context or comments

No response

3. Can you help us with this feature?

dosubot[bot] commented 3 months ago

Yes, you can use the rewritten question in LLM. Dify allows you to configure the LLM to handle various tasks, including question generation and text summarization. You can format the rewritten question for use in an LLM by customizing the model input prompts and settings.

For example, you can set up a prompt like this:

{
  "prompt": "You need to decompose the user's input into 'subject' and 'intention' in order to accurately figure out what the user's input language actually is. Notice: the language type user use could be diverse, which can be English, Chinese, Español, Arabic, Japanese, French, and etc. MAKE SURE your output is the SAME language as the user's input! Your output is restricted only to: (Input language) Intention + Subject (short as possible). Your output MUST be a valid JSON.",
  "variables": ["user_input"],
  "opening_statement": "Hi! I'm here to help you understand and decompose your input into subject and intention. Please provide your input in any language, and I'll respond in the same language."
}

To configure an LLM node in Dify, follow these steps:

  1. Selecting a Model: Complete the model configuration in "System Settings—Model Provider".
  2. Composing System Prompts: Customize the model input prompts.
  3. Memory Settings: Enable or disable system memory settings based on your needs.
  4. Memory Window Settings: Configure the number of historical dialogue messages to pass.
  5. Dialogue Role Name Settings: Set dialogue role names and modify the role prefix in conversation history.

For more detailed guidance, refer to the Dify documentation [1][2][3][4].

To continue talking to Dosu, mention @dosu.