Search code examples
openai-apichatgpt-api

What is the use case of System role


This is from the official documentation from ChatGPT chat completion:

openai.ChatCompletion.create(
  model="gpt-3.5-turbo",
  messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Who won the world series in 2020?"},
        {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
        {"role": "user", "content": "Where was it played?"}
    ]
)

My first understanding for the system role is a message that just to greeting the user. But it doesn't make sense to greet user by 'You are a helpful assistant.'.And it also explains:

The system message helps set the behavior of the assistant. In the example above, the assistant was instructed with "You are a helpful assistant."

So do I write the behavior of the AI in the system role like: You're professional assistant if I want the AI to be a pro or I can write in the role like: You're a funny assistant if I would like it to be a interesting AI.

Or it simply just a greeting message?


Solution

  • It's not for greeting the user but to say how ChatGPT should act. There are a lot of sample prompts in the web. Here you'll find some samples for those system prompts: https://github.com/f/awesome-chatgpt-prompts