Gotcha!
- Why use the JSON input?
Seems totally unnecessary for such a simple natural language question. I understand you want the response in an extractable/processable format, but actually JSON is often the most fragile and least-effective choice.
Even if you want JSON output, or some other kind of parse-able structured output, JSON is by far the most dense and least-natural language of all outputs. I know that they have pushed this option and tried to make it functional for developers but I think it’s kind of silly.
Instead you can just say, reply in exactly this way:
[LOAD_TYPE] = [LTL]
And then give it a list of options and also a better tabulated list of relevant factors to consider, like:
LTL |
FREIGHT |
DROP_SHIP |
LIFT_GATE |
If load is great than X |
if load is greater than Y |
if mention of Z |
if mention of pallet |
|
|
|
|
So you then:
- Simply provide your prompt (or list of prompts for classification!)
- Provide your list of “enum” (actually your not enumerating anything, your providing a list of selections based on query factors)
- Provide the response output structure that your middleware can handle
Is your question, how many queries can you make at once, 2 vs. 50? Or is your question actually “can I give 50 different options for the LLM to choose from when classifying”?
If the former, query length would be explicitly relevant more to the complexity and diversity of query. If it’s 1000 of the “same type of question”, and it was as simple as your example, I bet actually the LLM could handle that. If there’s a greater level of diversity/choices than what you provided, then I’d guess more to 100-200, and of course the more complex the less queries at once.
You’ll of course get best results doing single-query per shot.
In terms of the “classifications”, it’s really all about how you provide the data. If it’s tabular, well defined data options/selections, and your only providing a single query with say, 2 or 3 “parametesr” that the LLM has to “fill in from the available choices”, then so long as the query is clear, the available-choices-data-set-and-choice-parameters-matrix is clear, the LLM could in my opinion likely accurately choose between hundreds of options.
HOWEVER - the use cases you are describing and providing are NOT NEEDING TO USE THE LLM!
You’d be much better off in the examples you provided simply getting a basic application going that “take as a input a drop-down or text-area input selections from the user” and then “runs it through the parameter-filtration/choice-matrix based on necessary parameters”.
Thus, your backend-parameters providing your choices are also directly modifiable through a UI (what if shipping rates/load weights/types change slightly? You can modify your parameters table easily, and still use the same system), and the user simply inputs their data.
No need for complex use of LLM, expensive calls, or strange JSON structuring. Just a regular old very simple python application with a desktop or webapp UI will easily do the trick. Plus you can integrate with existing databases/applications if desired to pipeline things.
And the LLM can help you program it!