volver a tutoriales

Cómo utilizar los conjuntos de habilidades de ChatBotKit para crear un bot de previsión meteorológica

Aprende a crear un bot de previsión meteorológica utilizando los skillsets de ChatBotKit. Sigue la guía paso a paso para crear un conjunto de habilidades y una capacidad para obtener información meteorológica mediante solicitudes a la 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.