System and user prompts #196
chenxizhang
started this conversation in
Use cases
Replies: 0 comments
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
In the world of ChatGPT, prompts are crucial as they represent the instructions we, as users, use to interact with the large language model. There are two types of prompts: system prompt (specified by the system parameter in this cmdlet) and user prompt(specified by the prompt parameter in this cmdlet).
System prompt generally define the role, capabilities, and some rules you would like the large language model to follow while conversing with you or assisting you in generating content. User prompt usually refer to the specific tasks you want it to perform for you, such as writing an essay, etc.
Tip
These two parameters can be used separately or together. The system parameter has a default value, so it has a default setting whether or not you specify it. When you specify a prompt, it means that you are not looking to chat but to receive a direct text generation result.
Both are in the form of strings, but you have various options when specifying them.
Direct Input
This is the simplest method, where you can enter it directly in the command line, obviously suitable for simpler scenarios, such as:
File Input
While entering system or prompt directly in the command line is intuitive, the fact is that your commands are usually not that simple. At this point, you can save them in a file, and then pass the file path to the command.
Online Web Page
Another approach is to directly read from a web page URL as the input for system or prompt, provided that this file is publicly accessible.
Template Library
One of my proudest designs is that you can directly use template library prompts, quickly reusing them in your code. I currently maintain a prompt template library (https://github.com/code365opensource/promptlibrary), which already contains two templates (fitness, which is a fitness coach, and gpt-translator-md, which can translate an md file).
You can use them like this:
Beta Was this translation helpful? Give feedback.
All reactions