As I understand your response you get from booking consits of n amount of Hotel, and each Hotel has values.
You need to store all values (:each itemās name, :each itemās price, ā¦) in a seperate custom state which is a list of text. The order will be the same in each of these lists. Then you can reference in the RG (just make one for one Hotel Name) the item # current cells index and get the corresponding values from the other custom states.
And you can structure the JSON as request to GPT as follows:
Store API response as follows:
Hotel Names in as list of text (Custom State)
Price as a list of text (or number) (Custom State)
currency as a list of text (Custom State)
reviewScore as a list of text (or number) (Custom State)
checkin store as a list of text formatted like this-> formatting similar to below (Custom State)
{āfromā: ā14:00ā, āuntilā, ā23:00ā}
then for the query to GPT (why do you btw need a JSON, canāt you just send a string as query with a HTTP GET (or POST?) request to GPT?:
[ hotelNames:format as text]
And then format each element as follows
{
ānameā: āThis hotelNamesā,
āpriceā: priceās item# this hotelNames index,
ācurrencyā: ācurrenciesā item# this hotelNames indexā,
āreviewScoreā: reviewScoreās item# this hotelNames index,
ācheckinā: checkinās item# this hotelNames index"
}
And like this you have a string that is properly formatted as JSON (you can also do the formatting differently to suit your Format style 2
Perhaps also add an index number, so that GPT can answer with a structured JSON like
ārecommendationsā: [{
ātextā: āGPT recommends this hotel because itās awsomeā,
āindexā: 1},
{
ātextā: āGPT recommends this hotel because itās even betterā,
āindexā: 2}
]
And then you can map the response values to the hotels againā¦