BotSharp
BotSharp copied to clipboard
Add a regex expression validation for required fields.
Sometimes LLM will hallucinate and simulate a value that does not exist. For example, it fills in a false value in the order number below. I want a user-defined validator that can validate the data format in advance.
{ "function": "route_to_agent",
"reason": "User wants to pay in cash",
"next_action_agent": "Payment",
"user_goal_agent": "Payment",
"args": {
"order_number": "order number"
}
}
Below is part of the Router prompt:
* Agent: Payment
Make payment when user wants to pay for the order
Required args: {
"order_number": "order number",
}