#How to send multiple/parallel requests to the ChatGPT API

8 messages · Page 1 of 1 (latest)

rustic wraith
#

The textdavinci API has the possibility of sending a vector of prompts as input to compute multiple prompts in one call. How can one send multiple calls with the ChatGPT API ?

#

How to send multiple/parallel requests to the ChatGPT API

foggy anchor
#

no, 1 prompt = 1 conversation
it cant remember 2 split API calls

rustic wraith
manic mango
rustic wraith
# manic mango You can send all the prompts at once to the API in a prompts array You can also ...

Hi, thanks maybe I should have explicitly asked for an array.
Do you have an example of how you get it to make an array of answers from a sequence of questions?

I would like it to answer multiple categories per request.

I had tried asking it to send JSON format but that failed as it was inconsistent in the format. I also tried to get it to make a CSV table but it did not do as I wanted.

Maybe if I told it to pretend to be a Python function that takes as input a vector of questions and that outputs a vector of answers it would have followed. I could have maybe given it an explicit example of the format like (I did not try):

You are a Python function that takes as input a list of prompts and that outputs a list of answers. Do not provide any further text than the contents of the answer list. You will answer in the following format :

summarize and ask follow-up questions for each element of the array below :

[ (text 1), ( text 2) ]

Your answer array ( only provide the list ):

[ [Summary: (summary of text 1), Questions: (follow up questions of text 1)], [Summary: (summary of text 2), Questions: (follow up questions of text 2)] ]

#

For the asynchronous calls I use Python and it was a struggle to learn how to make asynchronous calls. The API often got stuck and I had to reboot my vs code notebook. If you also use python would you happen to have a snippet to share on how send to send asynchronous calls? I know that there is a snippet on the openai-python github page here: https://github.com/openai/openai-python. But I did not understand what should go in the "..." that they wrote.