Code used in session for Cisco Partners. Topic: Webex bots in Python.
- (free) Webex Message account free
- Python 3.9 download
- Ngrok download
- Libraries (webexteamssdk, requests, flask) (see below)
- (free) Kiara translate account via RapidAPI link
pip install webexteamssdk
pip install flask
pip install requests
Create a Webex Bot that translates text from a detected language to a configured destination language. Format:
<countrycode> <text_to_translate>
Example:
"de remember when we had live events with real people"
Will translate this scentence to 'de' (German)
As listed above
Using flask:
Using the Webex SDK - send message to Webex user:
step2-send-webexteams-message.py
Using the Webex SDK - create a webhook for the bot:
Get the actual message text:
Make the bot NOT respond to it's own messages
step5-bot-dontlistento-yourself.py
Now add the final step that turns it into a translation bot!
- Translation service: Kiara Translation API v2
- Code used in this session: this page (https://github.com/DJF3/webex-teams-bot-session)
Webex Developer News http://cs.co/webexdevlink
The ultimate Webex Developer Resources http://cs.co/webexdevinfo