Function Call
Function Calling is a mechanism enabling structured interaction between large language models and external tools or systems. During inference, the model identifies user intent and generates standardized function call requests containing function names and parameters; external systems execute these calls and return results to the model, which then produces the final response. This mechanism equips language models with the ability to access real-time data, perform computations, and invoke APIs, and is a core technology for building agents and tool-augmented applications.
Core Facts
During inference, large models read tool metadata as context and use semantic understanding to determine whether a tool needs to be called and what parameters to pass, a process known as Function Calling or Tool Use.
Function Call is a capability introduced by OpenAI in June 2023 with the GPT-3.5/GPT-4 API update, allowing developers to define JSON Schema descriptions of functions in API requests.
Function Calling机制中,开发者将工具的名称、功能描述、参数Schema(通常为JSON Schema格式)注入到模型的请求中,模型输出结构化的JSON而非自然语言来调用工具
Timeline (last 90 days)
LangChain solves the problem of limited large-model knowledge through the Function Call mechanism, allowing developers to call tools to obtain data after the model's training cutoff.
Web search relies on the Function Call mechanism: the system automatically invokes the search tool, extracts keywords from the user's question and passes them to the search engine, then organizes the retrieved results into the answer.
The function call formats of different model vendors differ slightly, and LangChain provides a unified abstraction for this.
Both LangChain4j and SpringAI provide encapsulation of the Function Call mechanism, defining function signatures through annotations or schemas, which reduces integration complexity.
Through the Function Call mechanism, LangChain lets the model call external tools to obtain real-time data (such as weather queries), and it can also perform precise calculations by calling a calculator tool.
callSkill essentially follows the Function Call pattern; there is a Tool method called callSkill in the application that determines which Markdown file to read based on the Skill's name.
LangChain provides a mechanism called Function Call that allows developers to invoke tools to obtain data that the model itself cannot access.
During inference, large models read tool metadata as context and use semantic understanding to determine whether a tool needs to be called and what parameters to pass, a process known as Function Calling or Tool Use.
The Function Calling workflow consists of five steps: defining the function, the model reasoning whether to invoke it, generating the function call instruction and preparing parameters, the developer's code actually executing the function, and the model generating the final answer from the returned result.
All Facts (20)
During inference, large models read tool metadata as context and use semantic understanding to determine whether a tool needs to be called and what parameters to pass, a process known as Function Calling or Tool Use.
80%VerifiedFunction Call is a capability introduced by OpenAI in June 2023 with the GPT-3.5/GPT-4 API update, allowing developers to define JSON Schema descriptions of functions in API requests.
80%VerifiedFunction Calling机制中,开发者将工具的名称、功能描述、参数Schema(通常为JSON Schema格式)注入到模型的请求中,模型输出结构化的JSON而非自然语言来调用工具
80%VerifiedAgent的核心公式为:Agent = 大模型 + 工具调用 + 自主决策能力
80%VerifiedMCP and OpenAI's Function Calling serve different roles: Function Calling is a temporary convention at the model level, while MCP is a persistent communication protocol at the application layer.
70%VerifiedLangChain provides a mechanism called Function Call that allows developers to invoke tools to obtain data that the model itself cannot access.
65%VerifiedThe mechanism of Function Calling is that developers predefine function names, parameter formats, and capability descriptions, and the large model autonomously decides when to call which function and generates call parameters that conform to the specification.
65%VerifiedThe Skill feature can only be used with large models that support Function Call.
65%VerifiedEvery Function Call must have a corresponding Function Call Output, and the call_id of both must be exactly identical; otherwise the OpenAI API will reject the request and return an error.
65%VerifiedThe LangChain framework provides a unified Tool interface layer on top of Function Calling, enabling the same set of Agent code to seamlessly switch between different underlying models.
65%UnverifiedClaude Code和Aider等成熟AI Agent都使用了Function Call机制而非纯提示词方案
85%UnverifiedFunction Call将工具定义从自然语言层面提升到API结构化层面,从根本上解决了大模型幻觉导致的格式不遵循问题
70%UnverifiedFunction Call通过JSON Schema定义工具,能让大模型以接近100%的准确率生成合法的工具调用请求
70%UnverifiedThe Function Calling workflow consists of five steps: defining the function, the model reasoning whether to invoke it, generating the function call instruction and preparing parameters, the developer's code actually executing the function, and the model generating the final answer from the returned result.
60%UnverifiedThe Skill module of Spring AI Agent Utils is implemented based on Function Call, does not depend on a specific large model, and can run on different models such as GPT-4, Claude, and Qwen.
60%UnverifiedLangChain solves the problem of limited large-model knowledge through the Function Call mechanism, allowing developers to call tools to obtain data after the model's training cutoff.
50%UnverifiedWeb search relies on the Function Call mechanism: the system automatically invokes the search tool, extracts keywords from the user's question and passes them to the search engine, then organizes the retrieved results into the answer.
50%UnverifiedThe function call formats of different model vendors differ slightly, and LangChain provides a unified abstraction for this.
50%UnverifiedBoth LangChain4j and SpringAI provide encapsulation of the Function Call mechanism, defining function signatures through annotations or schemas, which reduces integration complexity.
50%UnverifiedThrough the Function Call mechanism, LangChain lets the model call external tools to obtain real-time data (such as weather queries), and it can also perform precise calculations by calling a calculator tool.
50%