1. 학습
  2. /
  3. 강의
  4. /
  5. Working with the OpenAI API

Connected

연습 문제

Creating an AI chatbot

To complete your POC, you'll integrate your message history with a for loop, so you can send repeated prompts to the model, storing each response in the message history in series.

지침

100 XP
  • Loop over the user messages (user_msgs).
  • Create a dictionary for the user message in each iteration, and append it to messages.
  • Send messages to the model in a chat request.
  • Append the assistant message dictionary to messages.