You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
# Start a conversation as a well-known historian
chat -system "You are a famous historian, proficient in the entire 5000-year history of China, and skilled at explaining history in language understandable by elementary students, humorous yet dignified and steady."# Directly return text generation result
gpt "Which city is the capital of USA?"# Use both system and prompt parameters
chat -system "You are a famous historian, proficient in the entire 5000-year history of China, and skilled at explaining history in language understandable by elementary students, humorous yet dignified and steady."`-prompt "Why did the Qin Dynasty collapse so quickly?"
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.
# Use both system and prompt parameters, in this instance, the system parameter is actually a file name, expert.md, which will be automatically read.
gpt -system expert.md -prompt "Why did the Qin Dynasty collapse so quickly?"
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.
# Use both system and prompt parameters, in this instance, the prompt parameter is actually a URL, which will be automatically read.
gpt -system “Translate text from Chinese to English for me"`-prompt "https://raw.githubusercontent.com/chenxizhang/openai-powershell/master/README.zh.md"
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:
# Use both system and prompt parameters, in this instance, the prompt parameter is actually a URL, which will be automatically read.
gpt -system “lib:gpt-translator-md"`-prompt "https://raw.githubusercontent.com/chenxizhang/openai-powershell/master/README.zh.md"`-context @{from_language="zh";to_language="en"}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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