I am using OpenAI since is out and I think now is the time to add it to my flows as it is an awesome tool.
Because of the limitations to prompt size I want to know what is the best practice to read a json for 1000 products?
I already have implemented an API query that for example someone can add the product name or product code and get back basic results like price, photo and description.
In the case that someone know the exact name or product code the results are nice even without AI.
But what if someone search just “hair straightener” and I have 5 different hair straighteners products?
The json will return 5 products with all the product details (json elements). The size is big and the OpenAI don’t read it.
Is there any way that can make rules:
- if more than 1 “product_id” results in json,
- then filter the results and pass only product names, price and sku (to reduce json the size)
- and then parse it to OpenAI’s prompt and “ask customer which of these products customer want…”
- and then make a new query of the product with all details?
- Give final OpenAi answer about the product
Above is just my idea but I am open to better practices if you can suggest me something else.
thank you in advance!