retour aux tutoriels

Comment utiliser les ensembles de compétences de ChatBotKit pour créer un bot de prévisions météorologiques

Apprenez à créer un bot de prévisions météorologiques en utilisant les ensembles de compétences de ChatBotKit. Suivez le guide étape par étape pour créer un ensemble de compétences et une capacité à obtenir des informations météorologiques à l'aide de requêtes API.

To create a bot that can accurately tell the weather forecast, we need to follow the steps below:

  1. Create a Skillset in ChatBotKit.
  2. Create an ability named "get_weather" with the description "Get the weather of the provided location."
  3. Set the ability instruction to:
To get the weather you need to perform the following request: ```fetch GET https://wttr.in/{location}?format=4 HTTP/1.1 User-Agent: curl/7.61.1 ``` The {location} parameter could be any city. For example: ```fetch GET https://wttr.in/London?format=4 HTTP/1.1 User-Agent: curl/7.61.1 ``` Multiple locations can be requested like this: ```fetch GET https://wttr.in/{London,Paris}?format=4 HTTP/1.1 User-Agent: curl/7.61.1 ``` The response is a text document with weather information.

Note that we are simply describing how we want to perform requests to obtain the necessary information. Additionally, we use a special action called "fetch" to instruct your bot to retrieve information from another webpage.

Once the skillset and the ability are set, we can start using it in our conversational AI agents. Simply select the skillset in your Bot or Integration.

Now we can ask questions such as "What is the weather in London?" and the bot will be able to provide us with accurate weather information.