Giter VIP home page Giter VIP logo

vector-cloud's Introduction

Vector-cloud

Programs that make Vector talk to the cloud!

Building

To make it easy to cross-compile binaries on your computer that will run on Vector you'll first need the armbuilder docker image. It can be generated by running..

# make docker-builder

To build vic-cloud, run...

# make vic-cloud

To build vic-gateway, run...

# make vic-gateway

Example Customization

Let's have Vector refuse to give users information on Area 51 and then explictly state that all other information requests have been approved.

First we make the following changes to internal/voice/stream/context.go

diff --git a/internal/voice/stream/context.go b/internal/voice/stream/context.go
index 1d5df2c..564b22f 100644
--- a/internal/voice/stream/context.go
+++ b/internal/voice/stream/context.go
@@ -1,7 +1,9 @@
 package stream
 
 import (
-       "bytes"
+       "regexp"
+       
+       "bytes"
        "context"
        "encoding/json"
        "fmt"
@@ -155,6 +157,14 @@ func sendIntentResponse(resp *chipper.IntentResult, receiver Receiver) {
 
 func sendKGResponse(resp *chipper.KnowledgeGraphResponse, receiver Receiver) {
        var buf bytes.Buffer
+
+       found, _ := regexp.MatchString("area fifty one", resp.QueryText)
+       if found {
+         resp.SpokenText = "Information regarding Area Fifty One is classified. The Illuminati High Council has been notified of this request."
+       } else {
+         resp.SpokenText = "Information Request Approved. " + resp.SpokenText
+       }
+
        params := map[string]string{
                "answer":      resp.SpokenText,
                "answer_type": resp.CommandType,

Next compile, copy to Vector, and reboot.

grant@lord-humungus vector-cloud % make vic-cloud                        
echo `go version` && cd /Users/grant/src/vector-cloud && go mod download
  ... BUILD LOG OUTPUT ...
Packed 1 file.
grant@lh % ssh root@<VECTOR_IP> mount -o remount,rw /
grant@lh % scp build/vic-cloud root@<VECTOR_IP>:/anki/bin
vic-cloud                                              100% 4800KB   3.6MB/s   00:01    
grant@lh %                                                 
grant@lh % ssh root@<VECTOR_IP> /sbin/reboot            

And test after the reboot by saying "Hey Vector... Question... What is Area 51?" and "Hey Vector... Question... What is DogeCoin?"

vector-cloud's People

Contributors

ben-r-teng avatar grant-olson avatar dietb 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.