Function Description
The AI Prompts plugin allows inserting prompts before and after requests in LLM.
Execution Properties
Plugin execution phase: Default Phase
Plugin execution priority: 450
Configuration Description
Name | Data Type | Requirement | Default Value | Description |
---|---|---|---|---|
prepend | array of message object | optional | - | Statements inserted before the initial input |
append | array of message object | optional | - | Statements inserted after the initial input |
Message object configuration description:
Name | Data Type | Requirement | Default Value | Description |
---|---|---|---|---|
role | string | required | - | Role |
content | string | required | - | Message |
Example
An example configuration is as follows:
Using the above configuration to initiate a request:
After processing through the plugin, the actual request will be:
Based on the geo-ip plugin’s capabilities, extend AI Prompt Decorator plugin to carry user geographic location information.
If you need to include user geographic location information before and after the LLM’s requests, please ensure both the geo-ip plugin and the AI Prompt Decorator plugin are enabled. Moreover, in the same request processing phase, the geo-ip plugin’s priority must be higher than that of the AI Prompt Decorator plugin. First, the geo-ip plugin will calculate the user’s geographic location information based on the user’s IP, and then pass it to subsequent plugins via request attributes. For instance, in the default phase, the geo-ip plugin’s priority configuration is 1000, while the ai-prompt-decorator plugin’s priority configuration is 500.
Example configuration for the geo-ip plugin:
An example configuration for the AI Prompt Decorator plugin is as follows:
Using the above configuration to initiate a request:
After processing through the plugin, the actual request will be: