Filtering CSV data using Rasa-GPT

I am working on creating a smart trip planner through integrating Rasa with the GPT API, however I am running into some issues on filtering the CSV list of locations.

The CSV list consists of hundreds of places sorted out using the following parameters: {name of place, city, category, category}.

Since the NLU in my chatbot is GPT, GPT must filter out the data but it is too large, so I have to do the filtering using Rasa.

  1. For example the user might say “I am looking for a place to go to with my family”
  2. Rasa must send the query to GPT with a prompt to put the information in a JSON array like this: { name of place: city: category: family-friendly category 2: }
  3. GPT must send this array back to Rasa/python so we can use it to filter out all the CSV locations which have the “family-friendly” category.
  4. Rasa must then send back the qualified list of places + the user’s original prompt to GPT to produce a sequential trip.

I am having an issue with the 2nd & 3rd points here and would appreciate any help or tips!