Most generative AI apps use the chat completions API. You send a list of messages, and the model returns the next assistant message. Each message has a role. The system message (in newer models sometimes called the developer message) sets the model's behavior: persona, tone, rules, what topics to stay within, what to do when unsure and the output format. User messages are what the person typed. Assistant messages are the model's earlier replies. You can also include tool messages that return the results of function calls.
Keep reading for free
Create a free StudyToCert account to read the rest of this lesson: 5 more sections, 4 key terms, a real-world example, an exam tip and self-check questions. Every lesson, lab and practice test is free with an account.