Parameters that would be composed by the human.
Parameters that would be composed by the LLM.
Even though no property exists in the LLM side, the llm property would
have at least empty object type.
OptionalvalidateValidate function for separated arguments.
If the LLM part of separated parameters has properties, this validate
function validates the llm type.
You know what? LLMs (Large Language Models) like OpenAI frequently make mistakes when composing arguments for function calling. Even with simple types like
numberdefined in the parameters schema, LLMs often provide astringtyped value instead.
In such cases, you should provide validation feedback to the LLM using this
validatefunction. Thevalidatefunction returns detailed information about type errors in the arguments.
Based on my experience, OpenAI's
gpt-4o-minimodel tends to construct invalid function calling arguments about 50% of the time on the first attempt. However, when corrected through thisvalidatefunction, the success rate jumps to 99% on the second attempt, and I've never seen a failure on the third attempt.
Arguments to validate
Validation result
Collection of separated parameters.