Prompt Template
In order to meet the more customized requirements of developers for LLM, Dify has fully opened the built-in complete prompts in the Expert Mode and provided initial templates in the composition interface. Below are four initial templates for reference:
1. Using Chat models to build Conversational apps
SYSTEM
USER
ASSITANT
Prompt Structure:
Context
Pre-prompt
Query
2. Using Chat models to build Text Generator apps
SYSTEM
USER
ASSITANT
Prompt Structure:
Context
Pre-prompt
Query
3. Using Complete models to build Conversational apps
Prompt Structure:
Context
Pre-prompt
History
Query
4. Using Complete models to build Text Generator apps
Prompt Structure:
Context
Pre-prompt
Query
Dify has collaborated with some model providers for joint deep optimization of system prompts, and the initial templates for some models may differ from the examples provided above.
Parameter Definitions
Context: Used to insert related text from the knowledge as context into the complete prompts.
Pre-prompt: Pre-prompts arranged in the Basic Mode are inserted into the complete prompts.
History: When building a chat application using text generation models, the system inserts the user's conversation history as context into the complete prompts. Since some models may respond differently to role prefixes, you can also modify the role prefix name in the conversation history settings, for example, changing the name "Assistant" to "AI".
Query: The query content represents variable values used to insert questions that users input during the chat.
Last updated