Skip to content

Function calling

A language model requests a described function with structured arguments; the connected application executes it.

Also known asTool calling
AI & Automation

How does function calling work?

Function calling connects a language model to described functions. The model can output a function name and corresponding structured arguments. The connected application performs the execution and may return the result to the model for the subsequent response. The integration must define which functions are available and under what conditions they may run. A correctly formatted call establishes neither authority for the action nor the factual accuracy of its arguments.

In a fictional warehouse assistant, the function get_stock queries inventory. The parameter item_code is intended to identify the item P-73. Before the query, the application checks whether the item code is valid and whether the requester may view that stock. The assistant bases its answer on the actual result. If the service is unavailable, the process needs an appropriate error state. Reading a stock quantity does not reserve goods; that would require a separate authorised action with a confirmed result. The team therefore also plans checks for invalid items and missing access rights.

Sources

Articles on this topic

AI & Automation with ASES

AI assistants and automated workflows