Felix-Ma/Berkeley-Function-Calling-Leaderboard huggingface dataset:
user: I've been brushing up on my linear algebra and I'm working with matrix operations. I have these two matrices I need to multiply: the first one, matA, contains [[1, 2], [3, 4]] and the second one, matB, contains [[5, 6], [7, 8]]. Could you multiply these two for me? Also, while you're at it, I have this list of numbers [1,2,3,4], and I'm looking to calculate the average. What's the mean of this list?

Available functions:
name: mat_mul
description: Multiplies two matrices.
parameters: type: dict
properties: matA: type: array
description: The first matrix.
items: type: integer
matB: type: array
description: The second matrix.
items: type: integer
required: matA
matB
name: calculate_mean
description: Calculates the mean of a list of numbers.
parameters: type: dict
properties: numbers: type: array
items: type: float
description: The list of numbers.
required: numbers

Ground-truth function call(s):
mat_mul(matA=[[1, 2], [3, 4]], matB=[[5, 6], [7, 8]])
calculate_mean(numbers=[1,2,3,4])
user: I've just sold some of my photography equipment and ended up with 1000 USD in my pocket. I'm planning a trip to Europe and it would be handy to have euros instead. Could you help me convert this amount into EUR? I'm curious to see how much I'll end up with for my trip. Oh, and just out of interest, I used to love math problems in school – could you calculate the factorial of 1000 for me? I know it's a huge number, but I'm just curious!

Available functions:
name: convert_currency
description: Converts a given amount from one currency to another using the ExchangeRate-API.
parameters: type: dict
properties: amount: type: float
description: The amount of money to convert, in the base currency.
from_currency: type: string
description: The ISO currency code for the base currency.
to_currency: type: string
description: The ISO currency code for the target currency.
required: amount
from_currency
to_currency
name: math_factorial
description: Calculates the factorial of a number.
parameters: type: dict
properties: n: type: integer
description: The number to calculate the factorial of.
required: n

Ground-truth function call(s):
convert_currency(amount=1000, from_currency='USD', to_currency='EUR')
math_factorial(n=1000)
user: I'm working on some research for a new material and need to calculate a few things. First off, I have a sample with a mass of 300 grams and its volume is 50 cubic centimeters; I need to determine its density. Once that's done, I'm interested in the Fibonacci sequence up to the 5th number. Lastly, I'm curious about the greatest common divisor between the mass and volume of my sample. Can you crunch these numbers for me?

Available functions:
name: calculate_density
description: Calculates the density of an object.
parameters: type: dict
properties: mass: type: float
description: The mass of the object, in kilograms.
volume: type: float
description: The volume of the object, in cubic meters.
required: mass
volume
name: get_fibonacci_sequence
description: Calculates the n numbers of the Fibonacci.
parameters: type: dict
properties: n: type: integer
description: The number of Fibonacci numbers to calculate.
required: n
name: math_gcd
description: Calculates the greatest common divisor of two numbers.
parameters: type: dict
properties: a: type: integer
description: The first number. This should be the larger number.
b: type: integer
description: The second number.
required: a
b

Ground-truth function call(s):
calculate_density(mass=0.3, volume=0.00005)
get_fibonacci_sequence(n=5)
math_gcd(a=300, b=50)
user: I'm in the process of buying a new home and have been working out the financials. I've just secured a loan for $350,000 with a 3.5% interest rate, and the loan period is set for 30 years. Could you help me figure out what my monthly mortgage payment would be?

On a different note, my niece asked me for some help with her math homework, and I thought you might assist. She's learning about least common multiples and was tasked to find the LCM of 15 and 25. Could you provide that as well?

Also, she's working on factorials and got stuck on calculating 7!. It would be great if you could show us the result of that.

Lastly, I've been brushing up on my calculus and was trying to estimate the derivative of the function f(x) = 3x^2 + 2x - 1 at the point where x equals 5. I’d appreciate it if you could help me with this calculation too.

Available functions:
name: mortgage_calculator
description: Calculates the monthly mortgage payment.
parameters: type: dict
properties: loan_amount: type: float
description: The amount of the loan.
interest_rate: type: float
description: The interest rate of the loan, ranging from 0 to 1.
loan_period: type: integer
description: The period of the loan, in years.
required: loan_amount
interest_rate
loan_period
name: math_lcm
description: Calculates the least common multiple of two numbers.
parameters: type: dict
properties: a: type: integer
description: The first number. This should be the larger number.
b: type: integer
description: The second number.
required: a
b
name: math_factorial
description: Calculates the factorial of a number.
parameters: type: dict
properties: n: type: integer
description: The number to calculate the factorial of.
required: n
name: estimate_derivative
description: Estimate the derivative of a function at a given point.
parameters: type: dict
properties: function: type: string
description: The function to calculate the derivative of.
x: type: integer
description: The point to calculate the derivative at.
required: function
x

Ground-truth function call(s):
mortgage_calculator(loan_amount=350000, interest_rate=0.035, loan_period=30)
math_lcm(a=15, b=25)
math_factorial(n=7)
estimate_derivative(function= 'lambda x : 3*x**2 + 2*x - 1', x=5)
user: We're tracking a rocket's trajectory, which aligns with a quadratic equation. The coefficients are a=2, b=-3, c=5. I need two things: first, to calculate the roots of this equation, and second, to determine the rate of change of the rocket's position when x equals 4. Can you process these for me?

Available functions:
name: get_distance
description: Calculates the distance between two 2D points.
parameters: type: dict
properties: pointA: type: tuple
description: The first point.
items: type: float
pointB: type: tuple
description: The second point.
items: type: float
required: pointA
pointB
name: quadratic_roots
description: Calculates the roots of a quadratic equation.
parameters: type: dict
properties: a: type: integer
description: The first coefficient.
b: type: integer
description: The second coefficient.
c: type: integer
description: The third coefficient.
required: a
b
c
name: estimate_derivative
description: Estimate the derivative of a function at a given point.
parameters: type: dict
properties: function: type: string
description: The function to calculate the derivative of.
x: type: integer
description: The point to calculate the derivative at.
required: function
x

Ground-truth function call(s):
quadratic_roots(a=2, b=-3, c=5)
estimate_derivative(function='lambda x: 2*x**2 - 3 * x + 5', x=4)
user: I've invested $5000 at an annual interest rate of 5% and plan to hold it for 10 years. I'd like to calculate the future value of this investment. Once I have that information, I'm considering purchasing a product from Amazon with the ASIN 'B08BHXG144' and would appreciate it if you could find out the current price for me. In addition, I'm looking up some details for a friend who lives in the area with the zip code '10001' and need to know which city this code is associated with. On a different note, for a math project, I'm working with the function f(x) = 3x^2 + 2x - 1 and I need to estimate the derivative at x = 2. Could you help me with these calculations?

Available functions:
name: calculate_future_value
description: Calculates the future value of an investment.
parameters: type: dict
properties: present_value: type: float
description: The present value of the investment, in dollars.
interest_rate: type: float
description: The interest rate of the investment, ranging from 0 to 1.
periods: type: integer
description: The number of periods, in years.
required: present_value
interest_rate
periods
name: retrieve_city_based_on_zipcode
description: Finds the city of a zipcode.
parameters: type: dict
properties: zipcode: type: string
description: The zipcode of the city.
required: zipcode
name: estimate_derivative
description: Estimate the derivative of a function at a given point.
parameters: type: dict
properties: function: type: string
description: The function to calculate the derivative of.
x: type: integer
description: The point to calculate the derivative at.
required: function
x
name: get_price_by_amazon_ASIN
description: Finds the price of a product by its Amazon ASIN.
parameters: type: dict
properties: ASIN: type: string
description: The Amazon ASIN of the product.
required: ASIN

Ground-truth function call(s):
calculate_future_value(present_value=5000, interest_rate=0.05, periods=10)
get_price_by_amazon_ASIN(ASIN='B08BHXG144')
retrieve_city_based_on_zipcode(zipcode='10001')
estimate_derivative(function='lambda x: 3*x**2 + 2*x - 1', x=2)
user: I've got coordinates for a place I'm doing some research on, specifically longitude 12.4924 and latitude 41.8902. I need to know what time zone it falls under. Also, I'm planning a trip to the UK next year, and I'm trying to avoid the busy holiday seasons. Could you tell me what the official holidays are for the UK in 2022?

Available functions:
name: get_time_zone_by_coord
description: Finds the timezone of a coordinate.
parameters: type: dict
properties: long: type: string
description: The longitude of the coordinate.
lat: type: string
description: The latitude of the coordinate.
required: long
lat
name: retrieve_holiday_by_year
description: Finds the holidays of a year.
parameters: type: dict
properties: year: type: string
description: The year of the holidays.
country: type: string
description: The country of the holidays. Possible options: US, AT, DE, ES, FR, GB, IT, NL, PL, RO, SK, UA.
required: year
country

Ground-truth function call(s):
get_time_zone_by_coord(long="12.4924", lat="41.8902")
retrieve_holiday_by_year(year="2022", country='GB')
user: Alright, I've got a few tasks to take care of. I need to look up the slang definition of "Hello World" to settle a debate with my friend about programming jargon. While doing that, I also have to check the latest one-month stock history for Apple Inc. (AAPL), and I need the data to include dividends and stock splits. I'm working on a physics project too, so I need to figure out the density of an object that weighs 10 kilograms and occupies a space of 2 cubic meters. Oh, and for my math homework, can you help me organize these numbers in descending order: [5, 2, 9, 1, 7, 4, 6, 3, 8]?

Available functions:
name: find_term_on_urban_dictionary
description: Finds the definition of a term on Urban Dictionary.
parameters: type: dict
properties: term: type: string
description: The term to find the definition of.
required: term
name: calculate_density
description: Calculates the density of an object.
parameters: type: dict
properties: mass: type: float
description: The mass of the object, in kilograms.
volume: type: float
description: The volume of the object, in cubic meters.
required: mass
volume
name: get_stock_history
description: Finds the price of a stock by its stock name.
parameters: type: dict
properties: stock_name: type: string
description: The stock name of the product, in the format of the stock symbol.
interval: type: string
description: The interval of the stock history. Allows one of following : 5m|15m|30m|1h|1d|1wk|1mo|3mo
diffandsplits: type: string
description: The diff and splits of the stock history. Allows one of following : true|false. Default to false
required: stock_name
interval
name: sort_array
description: Sorts an array of numbers.
parameters: type: dict
properties: array: type: array
items: type: float
description: The array of numbers.
reverse: type: boolean
description: Whether to sort the array in reverse order, i.e., descending order.
default: no
required: array

Ground-truth function call(s):
find_term_on_urban_dictionary(term='Hello World')
get_stock_history(stock_name='AAPL', interval='1mo', diffandsplits='true')
calculate_density(mass=10, volume=2)
sort_array(array=[5, 2, 9, 1, 7, 4, 6, 3, 8], reverse=True)
user: Could you fetch the current weather data for the location with the latitude 45.4215 and longitude -75.6972? Also, I need to calculate the chances of achieving exactly 3 successes out of 5 attempts, assuming there's a 50% probability of success on each attempt.

Available functions:
name: get_weather_data
description: Fetches weather data from the Open-Meteo API for the given latitude and longitude.
parameters: type: dict
properties: coordinates: type: array
items: type: float
description: The latitude and longitude of the location.
required: coordinates
name: calc_binomial_probability
description: Calculates the probability of getting k successes in n trials.
parameters: type: dict
properties: n: type: integer
description: The number of trials.
k: type: integer
description: The number of successes.
p: type: float
description: The probability of success.
required: n
k
p

Ground-truth function call(s):
get_weather_data(coordinates=[45.4215, -75.6972])
calc_binomial_probability(n=5, k=3, p=0.5)