An SDK for developing Webex Assistant Skills based on the MindMeld platform.
pip install webex_assistant_sdk
To use the SDK we just need to import SkillApplication and pass in the RSA private key as well as the secret for verifying the request's header.
Here is an example implementation which is found in the tests
folder:
from webex_assistant_sdk import SkillApplication
secret = 'some secret'
app = SkillApplication(__name__, secret=secret)
__all__ = ['app']
Similar to MindMeld applications, for development convenience, we have included a Flask server for you to test your application.
To run the development server you can use the run
command: python -m [app] run
.
We do not recommend using the development server for production purpose. To learn more about productionizing Flask application, please check Deployment Options.
The SkillApplication adds a introduce
decorator in addition to MindMeld's build in decorator. This is used to mark the dialogue state to use when a user calls a skill without any command, i.e. "talk to "
@app.introduce
def introduction(request, responder):
pass
To debug the server and turn off encryption/decryption, you can set the environment variable WXA_SKILL_DEBUG
to be True
.
Installing the webex_assistant_sdk package adds a wxa_sdk command line application. Use the -h
argument for help.
$ wxa_sdk -h
usage: wxa_sdk [-h] {new,generate-keys,invoke,check} ...
positional arguments:
{new,invoke,check}
new create a new skill project
invoke invoke a skill simulating a request from Webex
Assistant
check check the health and configuration of a Webex
Assistant Skill
optional arguments:
-h, --help show this help message and exit