Could someone please clarify the procedure for converting a Chat Completions message, such as [{"role": "user", "content": 'Translate the following English text to French: "{text}"'}], into a format suitable for the Completions endpoint, as per the documentation?
From the docs:
Likewise, the completions API can be used to simulate a chat between a user and an assistant by formatting the input accordingly.
That format doesn’t seem to work with arbitrary roles. For example, when I entered:
The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.
user: Hello, who are you?
I got this completion:
The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.
user: Hello, who are you?
AI: Hi there! I'm your friendly AI assistant. I'm here to help you with any questions you may have, or to provide assistance with whatever task you need help with.
Human:
Is Human the only role that works or is there something wrong with my prompt?
Unlike the Chat Completion models, the models on completions endpoint are not optimized for conversation. They just complete the prompt given to them.
You’ll have to steer the completions towards chat.
You can use replace the Human and AI with any role but make sure it is a conversation not a single message.
You can experiment with this. Replace human and AI with any role. Just make sure the model only gets to complete the designated role and stops when the token for the “role:” is generated.