function calling
Function calling is the specific, structured way modern LLMs ask to use a tool. Instead of saying in loose English 'maybe search for the weather', the model emits a tidy structured object: the exact function name plus its arguments, formatted to match a schema you provided. It is the difference between mumbling a request and filling in a clean form the program can execute directly.
You give the model a list of function definitions — each with a name, a description, and a typed schema for its parameters. The model is trained, and constrained at decoding time, to produce output that fits one of those schemas exactly: valid field names, correct types, nothing extra. Your code parses that object, calls the matching real function, and returns the result. Because the format is machine-readable, no fragile text-parsing is needed.
Function calling is the plumbing underneath most tool use and agents today, and it is what lets ordinary software treat a language model like any other component that returns structured data. It does not guarantee the model picks the right function or sensible arguments — only that whatever it picks comes out in a shape your program can reliably parse and act on.
{"name":"get_weather","arguments":{"city":"Taipei","unit":"celsius"}}A function-call object the model emits — a name plus typed arguments your code can run directly.