Prompt template
Run these steps in order.
01
Understand that GPT chat models require input as a series of messages, each with a role ('system', 'user', or 'assistant') and content. 02
The typical conversation starts with a 'system' message to set the assistant's behavior, followed by alternating 'user' and 'assistant' messages. 03
User messages represent instructions or queries from the end user or developer. 04
Assistant messages represent prior responses from the model or example outputs provided by the developer. 05
Including previous conversation messages is essential because the model does not retain memory between calls; relevant context must be included each time. 06
Be aware that conversation length is limited by the model's token limit; long histories may need trimming. 07
Review API responses, which include the assistant's reply under choices[0].message.content, and a finish_reason indicating if the response is complete or cut off.