GPT able to read/write data from GS, but not action instructions from prompt

Can someone please help with this?
We have done a lot of searching and experimentation, but just keep hitting a brick wall.

Thanks so much in advance.

Situation- I have the following command prompt:

  1. Parse all headers.
  2. Add a new key attribute called “Filter” to the end of dataset table.
  3. Concentrate on the content under these headers: ‘Name Of Reviewer’, ‘Date Of Review’ ‘User Location’, 'Review Score Given", ‘Review Description’,
  4. If a reviewer with an identical username has posted multiple reviews in the same calendar year with the same score, label all except the earliest review as “Bias” under the ‘Filter’ attribute

Notes: We are sending the data from a Google spreadsheet to OpenAI in a valid JSON format, asking it to complete the above steps and return the output data in a valid JSON format - which we later translate back into a new Googlesheet.

What works: Data is being read from Google Sheets and sent to OpenAI in a valid JSON format.

What is not working: GPT is not analysing the data properly and putting the word ‘Bias’ into the Filter column.
The same data and command prompt works perfectly if we were to use Open AI playground with the all of the same parameters.

Outcode contains the following instructions:
first_query = “You are a helpful assistant. you must only respond with a valid JSON string. Do not Add any comment. The format should be [{…}] without root node.”
first_query = system_message + " you must only respond valid json string. Do not Add any comment. The format should be [{…}] without root node."

First question:

  • how BIG is the dataset your sending, have you tried with a small subset.
  • how do you provide the google sheet data? As Dataframe? Or ?

Thanks for jumping in!

Small dataset. To give you a rough idea, 35 rows of text data.
Yes provide the google sheet data as a dataframe.

Is what you have 1 2 3 4 the actual prompt or is it more detailed? Are you presenting these data sorted by username so that those results you are looking for are adjecent? And this seems to only be meaningful if you had a full list of the year - I imagine that would not be 35 items. If the list is bigger than 32k it can never work the way you want to. In Googlescript it is very easy to do :slight_smile:

@jlvanhulst You’re right in that this is just a simple dataset. The intent was to start simple, so that I could understand terminology and way to write the prompt correctly before I built up the complexity.

I’m just not sure what I am doing wrong.

It all seems to work if I use the OpenAI playground with the same data, command prompt, model, parameters, etc.

[PS Once I’ve achieved the above, this specific task with the data will likely be done using a method outside of OpenAI.]

Are you actually creating an assistant and use the assistant? Your prompt should probably be way more detailed is what I have found. The full instructions should be in the assistant - in the actual promopt you would only provide your data and say something like process this json: …