Next.jsChat
Chat
So far you've learned how to generate text and structured data using single prompts. In this section, you will learn to use messages
to add a sequence of messages to the language model and generate the response based on the context of the conversation – called chat completion.