Skip to main content

Prompt Configuration Tutorial

Prompt is a core module that allows developers to customize the behavior of AI by providing input prompts. In advanced mode, the system displays internal prompt templates, which users can edit to configure tasks more flexibly.

Function of Prompts​

Prompts provide an input box where you can write instructions to define the AI's behavior, such as:

  • Guiding the model to answer questions in a specific tone or format.
  • Setting specific tasks, such as copywriting, question answering, code generation, etc.
  • Defining the background knowledge or language style that the model can use.

System Templates​

When selecting a knowledge base, the system automatically loads the default prompt template associated with that knowledge base. The template includes some tool variables and editable custom variables. The format for variables in the template is {{var}}, and variables related to the knowledge base are {{#context#}}.

Variable Explanation​

  • Tool Variables: These are variables that users define by selecting a tool and output variables, which can then be used in the prompt. The format is {{tool_output}}.
  • Custom Variables: Users can define their own variables, and the format is also {{user_input}}.
  • Knowledge Base Variables: When a specific knowledge base is selected, variables related to the knowledge base can be used, with the format {{#context#}}.

How to Write Prompts​

Basic Mode​

The basic mode provides a simple input box where users can directly input commands to define the AI's behavior. For example:

Features​

  • Quick configuration.
  • No complex formatting required.
  • Suitable for simple tasks.

Example:​

Using variables:

  • Tool Variables: For example, {{date}} can display the current date in the prompt.
  • Custom Variables: For example, {{user_name}} can be defined and used as needed.
Hello, {{user_name}}, today is {{date}}. Please tell me your question.

Using a Knowledge Base:

  • Suppose you selected a knowledge base named Product Knowledge. The system will automatically load the following template and append your input prompt to the end of the template:
Use the following context as your learned knowledge, inside <context></context> XML tags.

<context>
{{#context#}}
</context>

When answering the user:
- If you don't know, just say that you don't know.
- If you're unsure, ask for clarification.
Avoid mentioning that you obtained the information from the context.
And answer according to the language of the user's question.
Hello, {{user_name}}, today is {{date}}. Please tell me your question.

Advanced Mode (Click "SWITCH TO ADVANCED MODE")​

In advanced mode, the system automatically loads the default template related to the selected knowledge base. Editing this template helps you better control the generated content. In advanced mode, the system displays the following internal prompt template:

Use the following context as your learned knowledge, inside <context></context> XML tags.

<context>
{{#context#}}
</context>

When answer to user:
- If you don't know, just say that you don't know.
- If you don't know when you are not sure, ask for clarification.
Avoid mentioning that you obtained the information from the context.
And answer according to the language of the user's question.

Features​

  • Flexible configuration.
  • Suitable for complex or customized tasks.

πŸ”” Tips​

Switching Between Advanced Mode and Basic Mode​

  • Content edited in advanced mode will be lost when switching to basic mode.
  • When switching to Advanced Mode, the settings from Standard Mode are carried over.