As of now (as per March 2022), OpenAI’s gpt-3.5-turbo, which powers ChatGPT, does not officially support multi-user conversations. In the chat models, a conversation is typically framed as between a system and a user. However, you can work around this by managing conversation roles in your application.
You can include multiple user messages in the messages array and can use the ‘role’ field to indicate who is speaking. For ‘role’, you can use ‘user’, ‘assistant’, or any other role you want (like ‘User1’, ‘User2’, etc.), but you will need to manage the state and flow of the conversation. This approach can be used to implement a chat system with multiple users.
Here is an example of how you might include multiple users in a conversation:
```
‘messages’: [
{‘role’: ‘user1’, ‘content’: ‘Hello, how are you?’},
{‘role’: ‘user2’, ‘content’: ‘I am fine, thank you. How about you?’},
{‘role’: ‘system’, ‘content’: ‘Translate this conversation into French.’}
]
```
In the current model, this is a workaround and not officially supported behavior. Do take note that the assistant does not know the context that ‘user1’ and ‘user2’ are different. You can include ‘role’ in the ‘content’ to give more context to the assistant:
```
‘messages’: [
{‘role’: ‘user’, ‘content’: ‘User1 says: Hello, how are you?’},
{‘role’: ‘user’, ‘content’: ‘User2 says: I am fine, thank you. How about you?’},
{‘role’: ‘system’, ‘content’: ‘Translate this conversation into French.’}
]
```
For future updates, please refer to OpenAI’s documentation.