API Data Functions
Available on Azure OpenAI and OpenAI to connect custom API Functions to retrieve data.
Last updated
Available on Azure OpenAI and OpenAI to connect custom API Functions to retrieve data.
Last updated
Currently only suporting JSON response GET functions the Custom API allows an agent to fetch data from API sources based on user descriptions without any need to program. Simply input the Endpoint, Headers and Parameters and let AI do the rest for you.
Name: General name used for the function. (Only letters and numbers no special characters)
API Endpoint: Enter the API Endpoint with no "/" at the end of the URL
Description: General description of the data that will be returned and what types of questions this function can answer. When adding multiple functions to an agent it is important to rememeber this is the field which will help determine which function will be called.
EXAMPLE:
This is used to add headers to your call. In many cases you must add an Authorization Bearer Token which would look like the following
Parameters allow you to set static unchangeable values or dynamic values based on a description. By setting a value for the parameter it will never be changed by the AI Agent. Parameters will be placed in the query portion of the URL string:
Param Name: Name of the parameter (No Spaces)
Value: A hard coded value that will not change (Optional)
Description: If no Value is set you are able to describe to the AI agent the value you would like it to populate.
Required: If checked the agenet will make sure to have this value before executing the function and may prompt the user for more information if it cannot determine the value
EXAMPLE:
In the example below we are authenticating using a token parameter rather than a header which is quite comon among APIs. Every call will contain a token=XXXXXXX value in the query string when it is called.
token: Hard coded value that will always have the value of XXXXXXXXX.
to: "the end date in the format of YYYY-MM-DD" Here we are explaining to the AI agent that we require a specific date time format for the API. We are also telling it that this is the End Date.
from: "the start date in the format of YYYY-MM-DD" Here we are explaining to the AI agent that we require a specific date time format for the API. We are also telling it that this is the Start Date.
symbol: "the ticker of the company" Simply telling it we are looking for a ticker not a company name and that this value is required to execute the query.
In the end our URL will look like this.
https://finnhub.io/api/v1/company-news?to=2024-04-10&from=2024-04-03&symbol=AAPL&token=XXXXXXXXXXX
Before saving this configuration we require that you test the API Enter the values of the parameters entered and click "Test API" to see the results.
The console will display the results and the return values. If successful you will be able to save the API configuration and utilize it in any OpenAI or Azure OpenAI agent.