Chat GPT-4 Turbo

PAGATO
Da Swift API | Aggiornamento a day ago | Artificial Intelligence/Machine Learning
Popolaritร 

9.2 / 10

Latenza

6,115ms

Livello di servizio

99%

Health Check

100%

Torna a tutte le discussioni

How can I have a continuous conversation?

Rapid account: Kiekeer 12
Kiekeer12
6 months ago

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

Rapid account: Swift 4 API
Swift4API Commented 6 months ago

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.

Partecipa alla discussione - aggiungi un commento di seguito:

Accedi/Iscriviti per pubblicare nuovi commenti