Example skills and a cli utility written in Go for interacting with Webex Assistant Skills

Overview

Webex Assistant Skills - Go

Status GitHub tag (latest SemVer) GitHub GoDoc Go Report Card

This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills.

It is intended as an alternative to the official Webex Assistant SDK without the need for installing python and the required dependencies. Simply download the binaries from the releases tab to get started.

It is currently a work in progress, so expect things to change as more is learned about this new webex feature.

Quick Start

You should be famililar with the Getting Started documentation. This quickstart assumes you'll be using the simulator to test.

To get started, you will need:

  • Your tenant enabled for skills;
  • Your personal access token to register the skill: get your token here from the Copy button in the Authorization section;
  • Your base64 decoded developer ID: get your ID and base64 decode it here taking the last part after ciscospark://us/PEOPLE/
  • Your base64 decoded organisation ID (for the simulator): get your orgId and base64 decode it here taking the last part after ciscospark://us/ORGANIZATION/
  • A token with the assistant scope to run the skill. You can temporarily get this from here until there is proper tooling;
  1. Create a folder and download the binaries from the releases page:
    a. wxa-cli - for generating the keys and the secret, along with registering your skill;
    b. echo-skill-secure - for the test skill;
    c. echo-skill-secure-tester for testing the skill locally;

  2. Generate a public/private key pair:

$ ./wxa-cli generate-keys
  1. Generate a secret:
$ ./wxa-cli generate-secret > secret.txt
  1. (Optional) Set your environment variables or put them in a .env file:
SKILL_PUBLIC_KEY=<YOUR PUBLIC KEY HERE>
SKILL_PRIVATE_KEY=<YOUR PRIVATE KEY HERE>
SKILL_SECRET=<YOUR SECRET HERE>

If you don't set these, by default the skill will look in the current directory for secret.txt, private.pem and public.pem.

  1. Set up a tunnel to your machine using localtunnel or ngrok, e.g:
ngrok http 8080

Use the https endpoint provided by ngrok in the next step.

  1. Create the Skill on the Skills Service using the details obtained earlier:
$ wxa-cli create-skill --name="Echo" --url="
   
    "
    --contact="
   
    "
    -secret="$(cat secret.txt)" --public="$(cat public.pem)" --token="
   
    "
    --developerid="
   
    "
   

Replacing values in < > with the relevant details from earlier. Note the use of cat to provide the secret.txt and public.pem content into the command.

  1. Run the skill:
$ ./echo-skill-secure
  1. Test the skill locally:
$ ./echo-skill-secure-tester
  1. Test the skill with the simulator:
  • Visit https://assistant-web.intelligence.webex.com/.
  • Enter the base64 decoded organisation ID and the assistant scoped token.
  • Say or type ask echo hello there

Installation

Binaries

The simplest way is to download the binaries from the releases page.

Go Install

If you have Go installed, you can install using the following commands:

$ go install github.com/darrenparkinson/wxa-skills-go/cmd/[email protected]
$ go install github.com/darrenparkinson/wxa-skills-go/examples/[email protected]
$ go install github.com/darrenparkinson/wxa-skills-go/examples/echo-skill-secure/cmd/[email protected]

Compiling from source

Again, if you have Go installed, you can also compile from source:

$ git clone https://github.com/darrenparkinson/wxa-skills-go
$ cd wxa-skills-go
$ go mod tidy
$ go build ./cmd/wxa-cli
$ go build ./examples/echo-skill-secure
$ go build ./examples/echo-skill-secure/echo-skill-secure-tester
$ ./wxa-cli --version
Issues
  • wxa-cli - add invoke command

    wxa-cli - add invoke command

    Add the invoke command as per the python webex-skills command

    https://developer.webex.com/docs/api/guides/webex-assistant-skills-guide#building-a-simple-skill

    enhancement 
    opened by darrenparkinson 0
  • wxa-cli - add check command

    wxa-cli - add check command

    Implement the check command as per the python webex-skills command to run the healthcheck

    https://developer.webex.com/docs/api/guides/webex-assistant-skills-guide#building-a-simple-skill

    enhancement 
    opened by darrenparkinson 0
Releases(v0.2.0)
Owner
Darren Parkinson
Darren Parkinson
Simple Notifier/Listener utility package to pass around messages in-memory

Simple Observer (go) A small simple library to use for sending around messages in-memory. It uses a notifier/listener style messaging. Installation go

Daniël Pot 1 Dec 3, 2021
This is an example of a keep-it-simple directory layout for Go projects that was created using DDD principles, please copy and share if you like it.

DDD Go Template This project was created to illustrate a great architectural structure I developed together with @fabiorodrigues in the period I was w

Vinícius Garcia 13 Nov 25, 2021
Questions and answers example project.

Question Answer Service REST Service for questions and answers Database modeling Directory tree pkg: Here is the main source code. sql: Here are all t

Ken Esparta Ccorahua 1 Nov 22, 2021
Example repository for embedding Litestream in a Go application.

Litestream as Library This repository is an example of embedding Litestream as a library in a Go application. The Litestream API is not stable so you

Ben Johnson 33 Oct 18, 2021
go mev-geth example. signTx,send transaction to relay.

go-mev-geth go mev-geth example. signTx,send transaction to relay. sample smart contract /eth/contract/mevtransfer/mevtransfer.sol pragma solidity 0.6

Shiming 3 Jun 12, 2021
Example code for my Cadence Intro Workshop

Temporal Intro Workshop This repository contains example code for my Temporal Intro Workshop. Prerequisites Git, Make, etc. Make sure you have the lat

Márk Sági-Kazár 6 Oct 16, 2021
Example resource for alt:V Go module

Example resource for alt:V Go module

Timo 2 Sep 16, 2021
Example go clean architecture folder pattern

Golang Clean Architecture (Maintenance) Berikut ini adalah folder structure pattern yang biasa saya gunakan, walaupun tidak semua nya saya terapkan di

Restu Wahyu Saputra 24 Nov 30, 2021
Go realworld example

TODOs Users and Authentication POST /user/login: Existing user login POST /users: Register a new user GET /user: Get current user PUT /user: Update cu

Serhat Morkoç 5 Nov 21, 2021
A golang example of gRPCtutorials.

A golang example of gRPCtutorials.

null 0 Nov 20, 2021
slang 🐕‍🦺 | a Programing language written to understand how programing languages are written

slang ??‍?? goal was to learn how a interpreter works, in other works who does these programing languages i use on daily basis works behind the seen h

Ankit Yadav 1 Nov 18, 2021
📁 Examples for 🚀 Fiber - Express inspired web framework written in Go

?? Examples for ?? Fiber - Express inspired web framework written in Go

Fiber 1.1k Dec 4, 2021
Exercise project written in Go that I did on my own during the course "gRPC [Golang] Master Class: Build Modern API & Microservices" taught by Stephane Maarek on Udemy

calculator Exercise project written in Go that I did on my own during the course "gRPC [Golang] Master Class: Build Modern API & Microservices" taught

Marco Julián Torre 0 Nov 25, 2021
Go Cheat Sheet - An overview of Go syntax and features.

Go Cheat Sheet - An overview of Go syntax and features.

Ariel Mashraki 5.9k Nov 27, 2021
An online book focusing on Go syntax/semantics and runtime related things

Go 101 is a book focusing on Go syntax/semantics and all kinds of runtime related things. It tries to help gophers gain a deep and thorough understanding of Go. This book also collects many details of Go and in Go programming. The book is expected to be helpful for both beginner and experienced Go programmers.

Go101 4.1k Dec 2, 2021
This slide deck and supporting material is part of the Introduction to Go training course by Dave Cheney

This slide deck and supporting material is part of the Introduction to Go training course by Dave Cheney.

Dave Cheney 77 Nov 23, 2021
📖 Build a RESTful API on Go: Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.

?? Tutorial: Build a RESTful API on Go Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers. ?? The full article is published on Marc

Vic Shóstak 122 Nov 23, 2021
Assert your Go code is inlined and bounds-check eliminated

gcassert gcassert is a program for making assertions about compiler decisions in Golang programs, via inline comment directives like //gcassert:inline

Jordan Lewis 157 Nov 12, 2021
1000+ Hand-Crafted Go Examples, Exercises, and Quizzes

A Huge Number of Go Examples, Exercises and Quizzes Best way of learning is doing. Inside this repository, you will find thousands of Go examples, exe

İnanç Gümüş 11.8k Nov 29, 2021