chatGPT missing name field in Documentation

I saw chatGPT accept name field in the cookbook but the documentation doesn’t mention it. Which one is correct?
Cookbook Link:

Documentation Link:
API Reference - OpenAI API

My understanding was always that you can use up to one system message, and that system message needs to contain any instructions and examples in clear, plain English. I asked ChatGPT-4, and it stated that while multiple system messages are permitted, the Cookbook example isn’t.

I am an AI language model, and though I am based on the GPT-4 architecture, I can provide you with some information about GPT-3.5.

In the case of GPT-3.5, you can indeed use multiple system messages in a single API call. The purpose of system messages is to guide the model’s behavior during a conversation. By using multiple system messages, you can provide context, set specific instructions, or ask the model to remember certain facts throughout the conversation.

When using multiple system messages, make sure to format them correctly as part of the input. Here’s an example:


   {"role": "system", "content": "You are an assistant that speaks like Shakespeare."},
   {"role": "system", "content": "You are providing information about renewable energy sources."},
   {"role": "user", "content": "What art the benefits of solar energy?"}

This example sets the context by instructing the model to speak like Shakespeare and to provide information about renewable energy sources. The user’s query then follows, and the model will respond accordingly.

Remember, though, that providing too much context or instructions may lead to incomplete or truncated responses due to token limits. Make sure to keep the text within the allowed token range for your specific API plan.

(I asked about the Cookbook example)

The example you provided is not formatted correctly for an API call to GPT-3.5. The “name” attribute should not be used with system messages. The correct way to format the example would be using user and assistant roles for the conversation, like this:

messages = [
    {"role": "system", "content": "You are a helpful, pattern-following assistant that translates corporate jargon into plain English."},
    {"role": "user", "content": "New synergies will help drive top-line growth."},
    {"role": "assistant", "content": "Things working well together will increase revenue."},
    {"role": "user", "content": "Let's circle back when we have more bandwidth to touch base on opportunities for increased leverage."},
    {"role": "assistant", "content": "Let's talk later when we're less busy about how to do better."},
    {"role": "user", "content": "This late pivot means we don't have time to boil the ocean for the client deliverable."},

In this revised example, the conversation is structured using user and assistant roles to represent the back-and-forth between the user and the AI model. The system message at the beginning sets the context for the assistant’s behavior, and the rest of the conversation proceeds using user and assistant roles as needed.

I’ve never needed to use the API in either of these ways, but it wouldn’t hurt to try stuff out and see if you get desirable results.

I am not sure if Chatgpt has knowledge about GPT-3.5 since its knowledge is limited until 2021.
I maintain dotnet SDK for openAI API, for me I would like to cover all possible ways to use API.
betalgo/openai: OpenAI ChatGPT, Whisper, GPT-3 and DALL-E dotnet SDK (