@@ -4,7 +4,10 @@ Programs that make Vector talk to the cloud!
44
55## Building
66
7- To build the binaries, you'll first need the armbuilder docker image. It can be generated by running..
7+ To make it easy to cross-compile binaries on your computer that will
8+ run on Vector you'll first need the armbuilder docker image. It can
9+ be generated by running..
10+
811```
912# make docker-builder
1013```
@@ -19,3 +22,60 @@ To build vic-gateway, run...
1922# make vic-gateway
2023```
2124
25+ ## Example Customization
26+
27+ Let's have Vector refuse to give users information on Area 51 and then
28+ explictly state that all other information requests have been approved.
29+
30+ First we make the following changes to ` internal/voice/stream/context.go `
31+
32+ ``` diff
33+ diff --git a/internal/voice/stream/context.go b/internal/voice/stream/context.go
34+ index 1d5df2c..564b22f 100644
35+ --- a/internal/voice/stream/context.go
36+ +++ b/internal/voice/stream/context.go
37+ @@ -1,7 +1,9 @@
38+ package stream
39+
40+ import (
41+ - "bytes"
42+ + "regexp"
43+ +
44+ + "bytes"
45+ "context"
46+ "encoding/json"
47+ "fmt"
48+ @@ -155,6 +157,14 @@ func sendIntentResponse(resp *chipper.IntentResult, receiver Receiver) {
49+
50+ func sendKGResponse(resp *chipper.KnowledgeGraphResponse, receiver Receiver) {
51+ var buf bytes.Buffer
52+ +
53+ + found, _ := regexp.MatchString("area fifty one", resp.QueryText)
54+ + if found {
55+ + resp.SpokenText = "Information regarding Area Fifty One is classified. The Illuminati High Council has been notified of this request."
56+ + } else {
57+ + resp.SpokenText = "Information Request Approved. " + resp.SpokenText
58+ + }
59+ +
60+ params := map[string]string{
61+ "answer": resp.SpokenText,
62+ "answer_type": resp.CommandType,
63+ ```
64+
65+ Next compile, copy to Vector, and reboot.
66+
67+ ``` bash
68+ grant@lord-humungus vector-cloud % make vic-cloud
69+ echo ` go version` && cd /Users/grant/src/vector-cloud && go mod download
70+ ... BUILD LOG OUTPUT ...
71+ Packed 1 file.
72+ grant@lh % ssh root@< VECTOR_IP> mount -o remount,rw /
73+ grant@lh % scp build/vic-cloud root@< VECTOR_IP> :/anki/bin
74+ vic-cloud 100% 4800KB 3.6MB/s 00:01
75+ grant@lh %
76+ grant@lh % ssh root@< VECTOR_IP> /sbin/reboot
77+ ```
78+
79+ And test after the reboot by saying "Hey Vector... Question... What is Area 51?" and
80+ "Hey Vector... Question... What is DogeCoin?"
81+
0 commit comments