Reference · Glossary

Function calling

When an LLM **returns a structured request** to run a function (API, database, calculator) instead of answering directly — the app executes and may send results back.

When to use

Weather lookups, booking, CRM updates, code execution, anything that needs live data or actions.

When not to

Pure Q&A over static text — RAG or prompt alone may suffice without tools.

Example

User: "What's the weather in Dubai?"

Model returns: `get_weather(city="Dubai")` → your code calls the API → model summarizes the result.