Chat GPT-4 Turbo

BEZAHLT
Durch Swift API | Aktualisiert a day ago | Artificial Intelligence/Machine Learning
Popularität

9.2 / 10

Latenz

6,115ms

Service Level

99%

Health Check

100%

Zurück zu allen Diskussionen

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.

Nehmen Sie an der Diskussion teil - fügen Sie unten einen Kommentar hinzu:

Anmelden / Registrieren, um neue Kommentare zu veröffentlichen