←voltar para tutoriais
Como usar os conjuntos de habilidades do ChatBotKit para criar um bot de previsão do tempo
Saiba como criar um bot de previsão do tempo usando os conjuntos de habilidades do ChatBotKit. Siga o guia passo a passo para criar um conjunto de habilidades e uma capacidade de obter informações meteorológicas usando solicitações de API.
To create a bot that can accurately tell the weather forecast, we need to follow the steps below:
- Create a Skillset in ChatBotKit.
- Create an ability named "get_weather" with the description "Get the weather of the provided location."
- 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.