An SDK for developing applications for Webex Assistant.
Project description
Webex Assistant SDK
An SDK for developing Webex Assistant Skills based on the MindMeld platform.
Install the SDK
pip install webex_assistant_sdk
Using the 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:
import os
from webex_assistant_sdk import SkillApplication
from webex_assistant_sdk.crypto import load_private_key_from_dir
secret = 'some secret'
key = load_private_key_from_dir(os.path.realpath(os.path.dirname(__file__)), password=None)
app = SkillApplication(__name__, secret=secret, private_key=key)
__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 introduce decorator
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 "
Example
@app.introduce
def introduction(request, responder):
pass
Command Line
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} ...
positional arguments:
{new,generate-keys,invoke}
new create a new skill project
generate-keys generate keys for use with a Webex Assistant Skill
invoke invoke a skill simulating a request from Webex
Assistant
optional arguments:
-h, --help show this help message and exit
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for webex-assistant-sdk-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84ff89ad762560a961622d234c78bfd1a3c4f77d89ca91617181fecfd73ac094 |
|
MD5 | 296981bb57aad07fa6f74dc0195e48bc |
|
BLAKE2b-256 | 572a8ae44b739e1440022a543c494e9806d82232e71a52b175b85ba56520e944 |
Hashes for webex_assistant_sdk-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bd073fbe4ec856cfb5009df3fad792e79dd1a495e999e9cb38b83e219347455 |
|
MD5 | 6419e93911a71c8ad5d3053a6c8c93e9 |
|
BLAKE2b-256 | 053d1a9998673de9f71377f631a58aa022e0b90a5aa45fd4cfadb83030262f49 |