Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ New rule - Do you use the system prompt? #6869

Merged
merged 12 commits into from
Sep 29, 2023
1 change: 1 addition & 0 deletions categories/artificial-intelligence/rules-to-better-gpt.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ index:
- website-chatbot
- use-semantic-kernel
- use-embeddings
- use-system-prompt
---
Binary file added rules/use-system-prompt/helpful-assistant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions rules/use-system-prompt/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
type: rule
title: GPT - Do you use the system prompt?
uri: use-system-prompt
authors:
- title: Jack Reimers
url: https://www.ssw.com.au/people/jack-reimers
created: 2023-09-28T12:00:00.000Z
guid: d98b6b99-28a2-4be3-8095-6f5c45094a98
---

When you're building a custom AI application using a GPT API you'll probably want the model to respond in a way that fits your application or company.
You can achieve this using the system prompt.

<!--endintro-->

### What is the system prompt?

Requests to and from a GPT API generally have three types of messages, also known as roles or prompts.

**User**
User messages are any messages that your application has sent to the model.

**Assistant**
Assistant messages are any messages that the model has sent back to your application.

**System**
The system prompt is sent with every request to the API and instructs the model how it should respond to each request.

![Figure: The default helpful assistant prompt](helpful-assistant.png)

![Figure: We can use the system prompt to make GPT unhelpful](unhelpful-assistant.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you come up with an example where the system prompt makes it better instead of worse 😁


For more information on system prompts, see [OpenAI's documentation](https://platform.openai.com/docs/guides/gpt-best-practices/strategy-write-clear-instructions), or use their [playground](https://platform.openai.com/playground) to start testing your own!
Binary file added rules/use-system-prompt/unhelpful-assistant.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading