All Questions
Agents And Tool Use medium

Your `update_order` tool takes a free-text `action` string. The model sometimes passes values like 'cancel it please' or 'refund+cancel', which the backend misinterprets. What is the most robust fix?

  1. A Replace the free-text param with typed fields and an enum of allowed actions, validate on the host, and return clear errors.
  2. B Keep the free-text param and add a parser that uses a second LLM call to interpret whatever action string the model sends.
  3. C Add dozens of few-shot examples of correct action strings to the system prompt so the model learns the expected phrasing reliably.
  4. D Split into one tool per possible action phrasing, so the model always has an exact match for whatever it intends to do.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions