Felix-Ma/Berkeley-Function-Calling-Leaderboard huggingface dataset:
user: I'm in the middle of analyzing demographic data for a project and need to cross-reference some information based on zip codes. I've got a specific zip code, let's say 90210, and I need to find out which city it corresponds to. Can you help me retrieve the city name for this zip code?

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):
retrieve_city_based_on_zipcode(zipcode='90210')
user: I'm currently engaged in a study that requires me to investigate the holidays celebrated across different cultures and how they've evolved over the years. As part of this research, I'm compiling data on the national holidays in various countries for specific years. At the moment, I'm focusing on France. I need to know the list of holidays that were observed in France in the year 2010. Can you provide that information for me?

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):
retrieve_holiday_by_year(year='2010', country='FR')
user: I've got a dataset here that needs to be ordered from highest to lowest value. The numbers I'm working with are 34, 2, 56, 7, 9, and 12. Could you help me sort these in descending order?

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):
sort_array(array=[34, 2, 56, 7, 9, 12], reverse=True)
user: I need to calculate the sum of the binary numbers '10011' and '1100'. Could you help me with that?

Available functions:
name: add_binary_numbers
description: Adds two binary numbers.
parameters: type: dict
properties: a: type: string
description: The first binary number.
b: type: string
description: The second binary number.
required: a
b
name: convert_binary_to_decimal
description: Converts a binary number to a decimal number.
parameters: type: dict
properties: binary: type: string
description: The binary number to convert.
required: binary
name: convert_decimal_to_hex
description: Converts a decimal number to a hexadecimal number.
parameters: type: dict
properties: decimal: type: integer
description: The decimal number to convert.
required: decimal

Ground-truth function call(s):
add_binary_numbers(a='10011',b='1100')
user: I've been working on some data analysis and I need to fit a linear regression model. I have these data points with x-coordinates as [1, 2, -3] and corresponding y-coordinates as [4, -5, 6]. I want to understand the relationship between these variables and make a prediction for when x is 10. Can you help me with that?

Available functions:
name: linear_regression
description: Finds the linear regression of a set of points and evaluates it at a given point.
parameters: type: dict
properties: x: type: array
description: The x coordinates of the points.
items: type: integer
y: type: array
description: The y coordinates of the points.
items: type: integer
point: type: integer
description: The point to calculate the linear regression at.
required: x
y
point
name: calculate_slope
description: Calculates the slope of the linear regression line from a set of points.
parameters: type: dict
properties: x: type: array
description: The x coordinates of the points.
items: type: integer
y: type: array
description: The y coordinates of the points.
items: type: integer
required: x
y
name: calculate_intercept
description: Calculates the y-intercept of the linear regression line from a set of points and a given slope.
parameters: type: dict
properties: x: type: array
description: The x coordinates of the points.
items: type: integer
y: type: array
description: The y coordinates of the points.
items: type: integer
slope: type: integer
description: The slope of the linear regression line.
required: x
y
slope
name: predict_value
description: Predicts the value of y given the slope, intercept, and an x value.
parameters: type: dict
properties: slope: type: integer
description: The slope of the linear regression line.
intercept: type: integer
description: The y-intercept of the linear regression line.
x: type: integer
description: The x value to predict the y for.
required: slope
intercept
x

Ground-truth function call(s):
linear_regression(x=[1,2,-3],y=[4,-5,6],point=10)
user: I've been planning my financial future and I've decided to make an initial investment of $10,000, followed by an annual contribution of $1,000. My investment plan will run for 5 years, and I'm expecting an annual return of 5%. However, I'm also aware that inflation can impact the value of my investment, so I've projected an inflation rate that changes year over year: 1% for the first year, 2% for the second, and so on, up to 4% for the last two years. I need to calculate the real value of my investment after accounting for these inflation rates. Can you provide me with the adjusted value of my investment over this 5-year period?

Available functions:
name: calculate_investment_value
description: Calculates the value of an investment over time.
parameters: type: dict
properties: initial_investment: type: integer
description: The initial investment amount.
annual_contribution: type: integer
description: The annual contribution amount.
years: type: integer
description: The number of years to calculate the investment value for.
annual_return: type: float
description: The annual return rate, ranging from 0 to 1.
inflation_rate: type: array
items: type: float
description: The inflation rate for each year in percentage, ranging from 0 to 1.
adjust_for_inflation: type: boolean
default: yes
description: Whether to adjust the investment value for inflation.
required: initial_investment
annual_contribution
years
annual_return
inflation_rate
name: compound_interest
description: Calculates compound interest over time.
parameters: type: dict
properties: principal: type: integer
description: The principal amount.
rate: type: float
description: The annual interest rate.
times_compounded: type: integer
description: The number of times the interest is compounded per year.
years: type: integer
description: The number of years to calculate the compound interest for.
required: principal
rate
times_compounded
years
name: inflation_adjustment
description: Adjusts an amount for inflation.
parameters: type: dict
properties: amount: type: float
description: The amount to adjust for inflation.
inflation_rate: type: float
description: The annual inflation float.
years: type: integer
description: The number of years to adjust for inflation.
required: amount
inflation_rate
years

Ground-truth function call(s):
calculate_investment_value(initial_investment=10000, annual_contribution=1000, years=5, annual_return=0.05, inflation_rate=[0.01,0.02,0.03,0.04,0.04])
user: I've got $1,000,000 set aside as an initial investment and plan to add $1,000 to it every year. I'm looking at a potential annual interest rate of 10% over the next three years. However, I also want to consider the inflation rates, which I expect to be 1% in the first year and 4% for the next two years. I need to calculate what the investment's value would be at the end of three years, factoring in these inflation rates. Can you help me with that?

Available functions:
name: calculate_future_value
description: Calculates the future value of an investment with periodic contributions.
parameters: type: dict
properties: present_value: type: integer
description: The present value of the investment.
annual_contribution: type: integer
description: The amount contributed to the investment annually.
years: type: integer
description: The number of years the investment will grow.
rate_of_return: type: float
description: The annual rate of return on the investment.
required: present_value
annual_contribution
years
rate_of_return
name: adjust_for_inflation
description: Adjusts the investment value for inflation for each year.
parameters: type: dict
properties: investment_value: type: float
description: The value of the investment to adjust.
inflation_rates: type: array
items: type: float
description: The inflation rates for each year.
required: investment_value
inflation_rates
name: calculate_investment_value
description: Calculates the value of an investment over time.
parameters: type: dict
properties: initial_investment: type: integer
description: The initial investment amount.
annual_contribution: type: integer
description: The annual contribution amount.
years: type: integer
description: The number of years to calculate the investment value for.
annual_return: type: float
description: The annual return rate, ranging from 0 to 1.
inflation_rate: type: array
items: type: float
description: The inflation rate for each year in percentage, ranging from 0 to 1.
adjust_for_inflation: type: boolean
default: yes
description: Whether to adjust the investment value for inflation.
required: initial_investment
annual_contribution
years
annual_return
inflation_rate

Ground-truth function call(s):
calculate_investment_value(initial_investment=1000000, annual_contribution=1000, years=3, annual_return=0.10, inflation_rate=[0.01, 0.04, 0.04])
user: I've been helping my grandmother to adopt a healthier lifestyle. She's 80 years old, and we've been quite active together lately. She's 170 cm tall and weighs 59 kg. Given that we're maintaining an activity level of 4 on the scale you've provided, we're aiming for a weight loss goal. Could you calculate her nutritional needs based on these details?

Available functions:
name: calculate_basal_metabolic_rate
description: Calculates the Basal Metabolic Rate (BMR) of a person.
parameters: type: dict
properties: weight: type: float
description: The weight of the person in kilograms.
height: type: float
description: The height of the person in centimeters.
age: type: float
description: The age of the person in years.
gender: type: string
description: The gender of the person. Possible options [male, female, other].
required: weight
height
age
gender
name: calculate_daily_energy_expenditure
description: Calculates the daily energy expenditure based on BMR and activity level.
parameters: type: dict
properties: basal_metabolic_rate: type: float
description: The BMR of the person.
activity_level: type: float
description: The activity level of the person. Possible options [1,2,3,4,5].
required: basal_metabolic_rate
activity_level
name: calculate_nutritional_needs
description: Calculates the nutritional needs of a person based on their weight, height, age, gender, activity level, and goal.
parameters: type: dict
properties: weight: type: float
description: The weight of the person in kilograms.
height: type: float
description: The height of the person in centimeters.
age: type: float
description: The age of the person in years.
gender: type: string
description: The gender of the person. Possible options [male, female, other].
activity_level: type: float
description: The activity level of the person. Possible options [1,2,3,4,5].
goal: type: string
description: The goal of the person. Possible options [lose, gain, maintain].
required: weight
height
age
gender
activity_level
goal

Ground-truth function call(s):
calculate_nutritional_needs(weight=59,height=170,age=80,gender='female',activity_level=4,goal='lose')
user: I'm looking to reserve a deluxe room for a client whose ID is 123. They'll be staying from August 11th to August 15th, 2024. The room's nightly rate is $1000. Can you handle the booking for me?

Available functions:
name: book_room
description: Books a room for a customer.
parameters: type: dict
properties: room_type: type: dict
description: The room type to book.
check_in_date: type: string
description: The check-in date in format of MM-DD-YYYY.
check_out_date: type: string
description: The check-out date in format of MM-DD-YYYY.
customer_id: type: string
description: The customer ID.
discount_code: type: string
description: The discount code (if any).
required: room_type
check_in_date
check_out_date
customer_id
name: calculate_total_price
description: Calculates the total price of the room booking.
parameters: type: dict
properties: room_price: type: float
description: The price per night of the room.
nights: type: integer
description: The number of nights for the booking.
discount: type: float
description: The discount amount (if any).
default: 0
required: room_price
nights
name: confirm_booking
description: Confirms the room booking and sends a confirmation to the customer.
parameters: type: dict
properties: customer_id: type: string
description: The customer ID.
room_number: type: string
description: The room number assigned to the booking.
total_price: type: float
description: The total price for the booking.
required: customer_id
room_number
total_price

Ground-truth function call(s):
book_room(room_type='deluxe',price=1000,check_in_date='08-11-2024',check_out_date='08-15-2024',customer_id='123')
user: I'm planning to host a dinner party tonight and thought of serving some delicious dumplings and rice bowls. I need to order 101 dumplings at $0.1 each and 20 rice bowls at $10 per bowl. Can you calculate the total price for this order for me?

Available functions:
name: order_food
description: Orders food for a customer. Return the total price.
parameters: type: dict
properties: item: type: array
items: type: string
description: the name of the product.
quantity: type: array
items: type: integer
description: the number of the product purchased.
price: type: array
items: type: float
description: the price of the product.
required: item
quantity
price
name: calculate_total
description: Calculates the total price of an order given the quantities and prices.
parameters: type: dict
properties: quantities: type: array
items: type: integer
description: The quantities of each product.
prices: type: array
items: type: float
description: The price of each product.
required: quantities
prices
name: apply_discount
description: Applies a discount to the total price.
parameters: type: dict
properties: total: type: float
description: The original total price.
discount: type: float
description: The discount percentage to apply.
required: total
discount

Ground-truth function call(s):
order_food(item=['dumplings','rice bowl'], quantity=[101,20], price=[0.1,10])
user: I just rewatched "Pulp Fiction," and I'm curious about the mastermind behind its direction. Could you find out who directed this iconic movie for me?

Available functions:
name: get_movie_director
description: Fetches the director of a movie from the OMDB API.
parameters: type: dict
properties: movie_name: type: string
description: The name of the movie.
required: movie_name
name: calculate_interest_rate
description: Calculates the interest rate for a given principal, rate, and time.
parameters: type: dict
properties: principal: type: float
description: The initial amount of money.
rate: type: float
description: The interest rate per period.
time: type: float
description: The time the money is invested or borrowed for.
required: principal
rate
time
name: convert_temperature
description: Converts temperature from Celsius to Fahrenheit or vice versa.
parameters: type: dict
properties: temperature: type: float
description: The temperature to convert.
unit_from: type: string
description: The current unit of the temperature (Celsius or Fahrenheit).
unit_to: type: string
description: The unit to convert the temperature to (Celsius or Fahrenheit).
required: temperature
unit_from
unit_to
name: generate_random_number
description: Generates a random number within a specified range.
parameters: type: dict
properties: min: type: integer
description: The minimum value of the range.
max: type: integer
description: The maximum value of the range.
required: min
max

Ground-truth function call(s):
get_movie_director(movie_name='Pulp Fiction')
user: I'm planning a movie night for my family this weekend, and I want to make sure the film is appropriate for all ages. We've settled on the idea of watching "Avatar", but I need to confirm its age rating before we proceed. Could you find out the age rating for the movie "Avatar"?

Available functions:
name: get_movie_rating
description: Fetches the age rating of a movie from the OMDB API.
parameters: type: dict
properties: movie_name: type: string
description: The name of the movie.
required: movie_name
name: get_movie_genre
description: Retrieves the genre of a movie from the OMDB API.
parameters: type: dict
properties: movie_name: type: string
description: The name of the movie to retrieve the genre for.
required: movie_name
name: get_director_by_movie_name
description: Gets the director of a movie.
parameters: type: dict
properties: movie_name: type: string
description: The movie to find the director of.
required: movie_name

Ground-truth function call(s):
get_movie_rating(movie_name='Avatar')
user: I have a set of vertices: [[1,2],[3,4],[1,4],[3,7]], and I'm curious about the area that these points, when connected in order, would enclose to form a polygon. Could you calculate the area of this polygon for me?

Available functions:
name: convert_coordinates
description: Converts a list of tuples into a list of lists.
parameters: type: dict
properties: coordinates: type: array
items: type: tuple
items: type: float
description: A single coordinate represented by a tuple (x, y).
description: The coordinates to be converted, where each coordinate is a tuple (x, y).
required: coordinates
name: polygon_area
description: Calculate the area of a polygon given its vertices using the shoelace formula.
parameters: type: dict
properties: vertices: type: array
items: type: array
items: type: float
minItems: 2
maxItems: 2
description: A single vertex represented by a 2 element list [x, y].
description: The vertices of the polygon, where each vertex is a 2 element list [x, y].
required: vertices
name: validate_polygon
description: Checks if the given vertices form a valid polygon.
parameters: type: dict
properties: vertices: type: array
items: type: array
items: type: float
description: A single vertex represented by a 2 element list [x, y].
description: The vertices of the polygon, where each vertex is a 2 element list [x, y].
required: vertices

Ground-truth function call(s):
polygon_area(vertices=[[1,2],[3,4],[1,4],[3,7]])