# Impact of role "system" in chat completion API

**URL:** <https://community.openai.com/t/impact-of-role-system-in-chat-completion-api/924886>\
**Category:** Prompting\
**Tags:** chatgpt, api, gpt-4o\
**Created:** [August 28, 2024, 11:23am UTC](https://community.openai.com/t/impact-of-role-system-in-chat-completion-api/924886 "2024-08-28T11:23:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhutan219](https://sea2.discourse-cdn.com/openai1/user_avatar/community.openai.com/jhutan219/32/452456_2.png) [@jhutan219](https://community.openai.com/u/jhutan219)\
**Post date:** [August 28, 2024, 11:23am UTC](https://community.openai.com/t/impact-of-role-system-in-chat-completion-api/924886/1 "2024-08-28T11:23:09Z")

</div>

Is there a significant difference in using system prompts versus including instructions in the user message when working with GPT-4 for a chatbot? I’ve tried both approaches:

1. Using instructions in the system role:

```auto
messages=[
  {"role": "system", "content": "<instructions>"},
  {"role": "user", "content": "<User query>"},
  {"role": "assistant", "content": "<response>"},
]

```

1. Including instructions in the user message:

```auto
messages=[
  {"role": "user", "content": "<instructions><User query>"},
  {"role": "assistant", "content": "<response>"},
]

```

I haven’t noticed any significant differences in the responses when testing these approaches. Are there any practical implications or advantages to using the system prompt (approach 1) over including instructions in the user message?"

This formulation maintains the core of your question while providing clear context about the two approaches you’ve tried. It also emphasizes your main point of inquiry regarding any real differences or advantages in using the system prompt approach.

---

<div class="post-metadata">

**Author:** ![anon34024923](https://avatars.discourse-cdn.com/v4/letter/a/c77e96/32.png) [@anon34024923](https://community.openai.com/u/anon34024923)\
**Post date:** [August 28, 2024, 11:56am UTC](https://community.openai.com/t/impact-of-role-system-in-chat-completion-api/924886/2 "2024-08-28T11:56:38Z")

</div>

just to f\*\*\* you up more, this also works.

```auto
  conversation.forEach((msg) => {
    if (msg.role === "user") {
      message += `User: ${msg.message}\n`;
    } else if (msg.role === "assistant") {
      message += `${msg.message.replace("HelloGPT: ", "")}\n`; 
    }
  });
  const response = await openai.chat.completions.create({
    model: "gpt-4o-mini",
    messages: [
      {
        role: "system",
        content: message,
      },
    ],

```
