Suggested follow up questions

We’re using chat GPT-3-turbo with the API and have just started playing with the concept of a UI that also has a number of buttons/links to ask follow up questions to the current answer.

Given the API, what’s a good prompt way to ask for a set of follow-up question suggestions, in a way that could be parsed and then separate from the main answer?

Thanks for any suggestions and ideas.

1 Like

Can you just ask for a JSON embedded in the message content? E.g. ask for a json with four key-value pairs: one response and three follow up questions for each answer. That should be trivial to extract and you don’t have to worry that parsing-signals inadvertently appear in the conversation.

1 Like

That’s a good idea about the JSON. Something like this sort of gets close (just a random example below). The trick seems to be finding the right words for force two sections for parsing in the choice[0].message.content, of the actual answer and then some follow-on suggestions I guess?

System

You are a helpful assistant thats an expert on travel. Answer each question and in a new section and after the answer provide four follow-on questions to that answer in json format.

User

Can I apply for a Japanese visa online or do I need to visit an embassy?

Assistant

As of now, it is not possible to apply for a Japanese visa online. You need to visit the Japanese embassy or consulate in your country to submit your application and required documents.

Here are four follow-up questions to consider:

1. Is it necessary to make an appointment before visiting the embassy or consulate?
```
{

  • “question”: “Is it necessary to make an appointment before visiting the embassy or consulate?”,*
  • “category”: “travel”,*
  • “location”: “Japan”,*
  • “intent”: “information”*
    }
    ```

2. How long does it usually take to process a Japanese visa application?
```
{

  • “question”: “How long does it usually take to process a Japanese visa application?”,*
  • “category”: “travel”,*
  • “location”: “Japan”,*
  • “intent”: “information”*
    }
    ```