How to create concurrent requests in chatting module and update it in sheets

Hi Everyone,
I take row values from Google sheets and use them as input for chatgpt, whose output is returned back to the same sheet in adjacent cell. This setup is working fine. But Now I want to take multiple value and use them as input at the same time (parallel api requests) to openai. How to achieve this scenario?
I tried following two diagrams but can’t get what I want.

Thank You

You lost me on the multiple value/parallel api requests part. Are you saying you want to include the previous requests and results in the next call you are making?


Thanks for the quick reply. In google sheets, I have 100 values in column A. I want to execute all 100 values at the same time. Currently with my setup, Only one value is send to openai. I want all 100 to be sent to openai’s API at same time and get response in same sheet in adjacent cell, Column B.

I don’t think it is possible to trigger 100 rows “at the exact same time”. Getting the Range should cycle through all 100 rows and do the OpenAI API call and then update the Google sheet but they are going to process serially as it loops through the 100 rows. Looking at your image I would think that is how you have it setup right now so unless it isn’t doing what I’m describing (and there is an error) I’m not sure how to help past this if that isn’t what you want.