Typed function and tool dispatch
Map natural language to one known function and closed-set arguments.
01
HOW IT WORKS
TOOLS = {
"show_price_chart": {
"description": "Show historical price data for one supported symbol.",
"symbols": {"AAPL": "Apple", "MSFT": "Microsoft", "NVDA": "NVIDIA"},
"windows": {"1d": "one day", "1w": "one week", "1mo": "one month"},
},
"list_symbols": {
"description": "List the symbols supported by the application.",
},
}The TypeSafe function-calling cookbook expands each closed set into a Choice or Noul, includes a function-selection question, and leaves free-form or numeric parameters to the function’s own validation/defaults. The returned values are still untrusted input to the application: check authorization, resource ownership, and business rules before calling anything.
Source: Function calling.
阈值归代码管
这个模式的一句话