How can I send Very big list of categories for text categorization UseCase and use it for further requests

In my app, a user types the description of Task/Job. I want the AI to offer him the best matching Categories/Subcategories. I have a list of 100 Categories and 750 subcategories. It is not feasible to always send that Big list a part of prompt.

What solution I available with OpenAI apis? I have gone through many blogs and documentation but still not able to figure it out

It seems the best way to provide access to your 75000 subcategories is to create two functions callable by the AI: one that allows the AI to receive the main list of categories and their descriptions, and one that allows the AI to request subcategories obtained off the main list. You can also, by providing robust function call chat history, entice the AI to also call for multiple subcategories if the first seems sub-optimal.

One can also just write the subcategory function with an enum that only accepts subcategory_keyword list, but this disallows per-subcategory description.

1 Like