Git Product home page Git Product logo

webex-assistant-sdk's Introduction

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

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.

$ 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

webex-assistant-sdk's People

Contributors

minhtuev avatar jjjacksn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.