You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/pages/blog/understanding-function-calling-in-llm-and-its-difference-to-rag.mdx
+5-5
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,9 @@ Both Function Calling and RAG aim to supplement the prompt with context, whether
33
33
34
34
### Function Calling in LLMs
35
35
36
-
**Function Calling** in large language models (LLMs) is a technique that allows these models to extend their functionality by interfacing with external APIs and tools. `This capability enables LLMs to break free from their text-based limitations and interact with the real world, performing actions, controlling devices, and retrieving information from databases.`
36
+
**Function Calling** in large language models (LLMs) allows these models to extend their functionality by interfacing with external APIs and tools. `This capability enables LLMs to break free from their text-based limitations and interact with the real world, performing actions, controlling devices, and retrieving information from databases.`
37
37
38
-
By providing the LLM with a set of functions or tools, along with their descriptions and usage instructions, the model can intelligently select the appropriate functions to accomplish a given task. This process is known as Function Calling, or sometimes tool use or API calling.
38
+
By providing the LLM with a set of functions, along with their descriptions and usage instructions, the model can intelligently select the appropriate functions to accomplish a given task. This process is known as Function Calling, or sometimes tool use or API calling.
39
39
40
40
Function calling allows LLMs to generate structured outputs, such as JSON objects or programming language instructions, which can be reliably read by other processes. This structured output is crucial for integrating LLMs into data pipelines and ensuring that the generated data can be used for downstream processing.
41
41
@@ -45,13 +45,13 @@ Function calling has emerged as a significant technique, particularly in models
45
45
46
46
### How Function Calling Works
47
47
48
-
Applications typically invoke the LLM with function-calling capabilities twice: once to map the prompt into the target function name and its input arguments, and again to send the output of the invoked function to generate the final response. This two-step process ensures that the model can accurately and efficiently perform the required tasks.
48
+
Agent typically invoke the LLM with function-calling capabilities twice: once to map the prompt into the target function name and its input arguments, and again to send the output of the invoked function to generate the final response. This two-step process ensures that the model can accurately and efficiently perform the required tasks.
The process begins when a user submits a prompt to an application responsible for handling communication between the user and the model. This application also provides the model with one or more tool or function definitions. The model then selects the appropriate function to execute based on the user prompt.
53
53
54
-
Once the model identifies the suitable function, it returns the function name and the necessary values to the application. The application then executes the function and returns the API response to the model. The model uses this response to generate the final output, which is then delivered back to the user through the application.
54
+
Once the model identifies the suitable function, it returns the function name and the necessary values to the application. The application then executes the function and returns the invocation result to the model. The model uses this response to generate the final output, which is then delivered back to the user through the application.
55
55
56
56
For example, a query like `What is the weather like in San Francisco?` can be converted into a function call such as `get_current_weather('San Francisco', 'fahrenheit')`.
57
57
@@ -61,7 +61,7 @@ This technique is particularly useful for creating conversational agents that ca
61
61
62
62
### Applications of Function Calling
63
63
64
-
Function calling in large language models (LLMs) has revolutionized the development of conversational agents. By enabling these models to interface with external APIs, developers can create chatbots that provide more relevant and useful responses. For instance, a chatbot can answer complex questions by calling external knowledge bases or APIs, such as retrieving the current weather in a specific location.
64
+
Function calling has revolutionized the development of conversational agents. By enabling these models to interface with external APIs, developers can create chatbots that provide more relevant and useful responses. For instance, a chatbot can answer complex questions by calling external knowledge bases or APIs, such as retrieving the current weather in a specific location.
65
65
66
66
Another significant application of Function Calling is in natural language understanding. LLMs can convert natural language into structured JSON data, extract structured data from text, and perform tasks like Named entity recognition, Sentiment analysis, and Keyword extraction. This capability enhances the model's ability to process and understand human language in a more structured and actionable manner.
0 commit comments