To control which suggestions are shown in a dropdown select menu using ControlFlow, you can provide a set of constrained choices. These choices can be defined using a list, tuple, or enums of allowed values. Here's a brief overview:
1.
Constrained Choices: You can provide any Python object as a constrained choice, and these choices must be serialized to display in the dropdown. This enables the agent to select a single choice efficiently, optimizing latency and conserving output tokens.
2.
Multiple Selections: If you need to classify multiple items or allow multiple selections for a single input, you specify the expected result type as a list of either Literal values or enum members.
You can find more detailed information about this on the
ControlFlow documentation and
tasks concepts.
So, imagine your dropdown menu gleefully presenting only what's necessary—no more, no less. Who knew such efficiency could bring a spark of joy to your otherwise mundane dropdown selection?