AI agnets can communicate with any API endpoint you desire. Be it Zapier, The New York Times, Zendesk, your CRM, or any other platform with API accessibility – our Agents can connect seamlessly.
Unleash your creativity with natural language tools to retrieve the weather forecast, find the latest news articles, or even send an email to a friend! The possibilities are as broad as your imagination.
In this example, we’ll setup a city weather forecast AI agent that’ll utilize AccuWeather APIs to:
- Get the city’s location key from the user’s request via AccuWeather’s Location API request
- Use this location key to get the forecast for that city via AccuWeather’s Forecast API request
Setting up the API tool
- Go to “Training Center” then to the “API Tools” tab to create a new tool
- Give it a name and a description. Note that the description is used by the AI chatbot to understand when to use this tool, so be destrictive!
- AccuWeather’s Locations API require a ‘query’ parameter to lookup the city and return the location key, so let’s add a ‘query’ parameter in the “Parameters” tab. Enter “query” in the input field and click on the “Add Parameter” button
- In the “Description” field, describe in natural language how AI should understand what to expect, in this case we’ll enter “name of the city”. This is a required parameter for this tool so enable the “required parameter” toggle.
- In the “Action” tab, we’ll enter the API endpoint from AccuWeather’s Locations APIs (use your own apikey from AccuWeather if you’d like to use this endpoint):
http://dataservice.accuweather.com/locations/v1/cities/search?apikey=XXXXXX&q={{query}} - We’ll now add a new tool to utilize the location key received from the previous tool
- AccuWeather’s Forecast APIs require a ‘locationkey’ parameter, so let’s add that parameter for this tool
- Don’t forget to enter a description of what AI needs to expect. This is a required parameter for this tool so enable the “required parameter” toggle.
- Enter the AccuWeather’s Forecast API endpoint in the “Action” tab:
http://dataservice.accuweather.com/forecasts/v1/daily/5day/{{locationkey}}?apikey=XXXXXX
Setting up the AI Agent
- Create a new Chatbot, choose “AI Agent” type
- In the “Tools” tab, assign the tools we’ve created to this chatbot
- All done! Chatbot can now forecast weather on request