Skip to main content

An SDK for developing applications for Webex Assistant.

Project description

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:

from pathlib import Path

from webex_assistant_sdk.app import SkillApplication
from webex_assistant_sdk.crypto import load_private_key_from_file


secret = 'some secret'
key = load_private_key_from_file(str(Path(__file__).resolve().parent / 'id_rsa'))
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

Debugging

To debug the server and turn off encryption/decryption, you can set the environment variable WXA_SKILL_DEBUG to be True.

Command Line

Installing the webex_assistant_sdk package adds a wxa_sdk command line application. Use the -h argument for help.

Usage: wxa_sdk [OPTIONS] COMMAND [ARGS]...

Options:
  --install-completion [bash|zsh|fish|powershell|pwsh]
                                  Install completion for the specified shell.
  --show-completion [bash|zsh|fish|powershell|pwsh]
                                  Show completion for the specified shell, to
                                  copy it or customize the installation.

  --help                          Show this message and exit.

Commands:
  generate-keys    Generate an RSA keypair
  generate-secret  Generate a secret token for signing requests
  invoke           Invoke a skill running locally or remotely
  new              Create a new skill project from a template

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

webex-assistant-sdk-1.0.0.tar.gz (22.0 kB view hashes)

Uploaded Source

Built Distribution

webex_assistant_sdk-1.0.0-py3-none-any.whl (25.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page