give examples
- User
give examples
Assistant
Tool calling involves using external services or APIs, such as calling a weather API to get the current temperature or using a payment gateway API to process a transaction. Function calling, on the other hand, involves invoking predefined code functions within the same program, such as calling a function
add(a, b)to add two numbers or invoking a functionsort(list)to sort a list of numbers.Here are some examples:
Tool Calling:
- Calling a weather API to get the current temperature.
- Using a payment gateway API to process a transaction.
- Calling a machine learning model hosted on a cloud service to make predictions.
Function Calling:
- Calling a function
add(a, b)to add two numbers. - Invoking a function
sort(list)to sort a list of numbers. - Using a function
calculate_area(radius)to calculate the area of a circle.
These examples illustrate the difference between tool calling and function calling.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.