Configuration file setup
This article is a part of a tutorial about creating a bot which reports the current weather in any city of the world.
- Configuration file setup (you are here)
- HTTP request to OpenWeatherMap API
- Script development
- Testing
First, we will create an account on the OpenWeatherMap website, get a personal API key, and set up the bot configuration file.
Getting an API key
Let’s get an API key to the OpenWeatherMap service. The API key is used to identify a specific client, so the service determines what data can be given to the client.
- Sign in to your OpenWeatherMap account or create a new one.
- Go to the API keys tab and copy
Default
key or create a new one in the Create key field. We will store the API key in thechatbot.yaml
configuration file.
tip
Learn more about OpenWeatherMap service in API documentation
Now, let’s move on to setting up the configuration file.
Configuration file
Create a chatbot.yaml
bot configuration file and set the following parameters:
# Project name
name: weather-api
# Main file
entryPoint:
- main.sc
# NLU parameters:
botEngine: v2
language: en
nlp:
intentNoMatchThresholds:
phrases: 0.2
patterns: 0.2
# OpenWeatherMap API key
injector:
api_key: '***'
caution
Type your API key in quotes
api_key: '***'
instead of ***
.Next, move on to working with HTTP request.