A Webex Teams bot to provide an estimate of similar products between the Catalyst and Meraki platforms through natrual language.
You can ask the Webex Teams bot various questions in natural language to convert between various Meraki and Catalyst switch models.
For example:
What is the equivalent of a C9500-24Q-A?
Convert a MS390-48UX2-HW with a MOD-2X40G network module to catalyst
Convert C9300L-48T-4G-E to meraki
Type help
to see a list of available commands.
As this bot relies on the Dialogflow NLP cloud platform - you will need to set up and configure your own trained model in order to deploy a local instance of this bot.
It is required to create an .env
file in the project directory to hold the following variables:
WEBEX_TEAMS_ACCESS_TOKEN=XXXXXX
DIALOGFLOW_PROJECT_ID=XXXXXX
GOOGLE_APPLICATION_CREDENTIALS=XXXXXX.json
DATABASE_URL='mysql+mysqlconnector://[email protected]:3306/catalyst_meraki'
The access token for your Webex Teams bot. Create one here.
Dialogflow requires setup to allow API access to different projects.
See Dialogflow Setup.
The path to your Google service account authentication credientials file. See above to setup through Dialogflow.
See Dialogflow Setup.
The MYSQL URI to the database holding switch information.
A local database could be: mysql+mysqlconnector://[email protected]:3306/catalyst_meraki
See Database Setup for information on setting up the database.
-
Edit
/tools/Catalyst_Meraki_Mapping.xlsm
as required. -
Navigate to the "Database" worksheet. Click the "Generate Script" button. This will generate a file called
import_script.sql
in thetools
directory. -
Install and start the MySQL server on your local computer. On mac this can be done with
brew install mysql
andmysql.server start
-
In the command line, navigate to the
tools
directory and run:$ mysql -u root < create_table.sql $ mysql -u root < import_script.sql
-
Your new MySQL database will now be accessable at
mysql+mysqlconnector://[email protected]:3306/catalyst_meraki
Setup a Dialogflow project with the following steps:
- Select or create a Cloud Platform project.
- Enable billing for your project.
- Enable the Google Cloud Dialogflow API.
- Set up authentication with a service account so you can access the API from your local workstation.
The Dialogflow model for this bot has been trained using various training phrases and entities created from the database. To setup for local testing, your Dialogflow project will need to have an intent that parses out two parameters:
Model
Network_Module
The fulfillment webhook also needs to be enabled to point to the /compare
app route.
-
Create and activate a python3 virtual environment:
$ python3 -m venv venv $ source venv/bin/activate
-
Install packages
pip install -r requirements.txt
-
Create .env file
touch .env
with appropriate tokens. See Configuration. -
Run
ngrok http 5000
-
Create Webex webhooks
$ python tools/create_webhooks.py
-
Run application
flask run