vector-cloud

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2021 License: MIT

README

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?"

Directories

Path Synopsis
ipc_manager.go handles messages between gateway and the following other processes: - vic-engine: There are both a CLAD (EngineCladIpcManager) and a Protobuf (EngineProtoIpcManager) domain socket connecting gateway to the engine.
ipc_manager.go handles messages between gateway and the following other processes: - vic-engine: There are both a CLAD (EngineCladIpcManager) and a Protobuf (EngineProtoIpcManager) domain socket connecting gateway to the engine.
internal
ipc
Package ipc provides a basic, dumb implementation of discrete messaging over various underlying transport protocols.
Package ipc provides a basic, dumb implementation of discrete messaging over various underlying transport protocols.
log
proto/external_interface
Package Anki_Vector_external_interface is a reverse proxy.
Package Anki_Vector_external_interface is a reverse proxy.
testing/time
Package time provides a wrapper for the Go time package that makes time based functions easier to test, while retaining the same api interface.
Package time provides a wrapper for the Go time package that makes time based functions easier to test, while retaining the same api interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL