Chat GPT-4 Turbo

שולם
על ידי Swift API | מְעוּדכָּן il y a un jour | Artificial Intelligence/Machine Learning
פּוֹפּוּלָרִיוּת

9.2 / 10

חֶבִיוֹן

6,115ms

רמת שירות

99%

Health Check

100%

חזרה לכל הדיונים

How can I have a continuous conversation?

Rapid account: Kiekeer 12
Kiekeer12
il y a 6 mois

How can I continue the previous round of the request dialogue?

Rapid account: Swift 4 API
Swift4API Commented il y a 6 mois

Hi,

You can continue the dialog by inserting the messages inside the messages array. For example:

{
  "messages": [
    {
      "role": "system",
      "content": "You are a helpful assistant."
    },
    {
      "role": "user",
      "content": "What is the result of 4 + 5"
    },
    {
      "role": "assistant",
      "content": "The result is 9"
    },
    {
      "role": "user",
      "content": "Add 10 to the previous result"
    },
    {
      "role": "assistant",
      "content": "If we add 10 to the previous result, which is 9, the result will be 19"
    }
  ]
}

As you can see inside the messages array, we can insert our messages with three roles:

  • "role": "system" which represents instructions for the AI model. Here you can tell the model how to act and respond.
  • "role": "user" which represents a user’s message.
  • "role": "assistant" which represents the model response.

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות