I collect here my notes on function definitions, schemas generated from functions, prompted function calling, and a practical workflow for handling function calls. This work connects to agent definitions and design.
I was curious how function definitions were being included in the prompt for OpenAI.
I documented my methods and what I found in a note linked at https://t.co/vwkUNcM0p1 and https://t.co/8frXkBsFtm.
I re-discovered @jeremyphoward’s code for creating schemas from functions: it takes 4 lines of code and has no deps except pydantic.
I said a model seems like it might be pretty capable OOB with right prompting to carry out func calling.
I described the model-choice step this way: The model will tell you if it wants to call a function which you can constrain with the enum + None.