OpenAI Agent
OpenAI API that supports function calling, it’s never been easier to build your own agent!
In this notebook tutorial, we showcase how to write your own OpenAI agent
Setup
First, you need to install the llamaindex
package. You can do this by running the following command in your terminal:
pnpm i llamaindex
Then we can define a function to sum two numbers and another function to divide two numbers.
function sumNumbers({ a, b }: { a: number; b: number }): number {
return a + b;
}
// Define a function to divide two numbers
function divideNumbers({ a, b }: { a: number; b: number }): number {
return a / b;
}