Skip to content

Commit

Permalink
allow using a local openai key
Browse files Browse the repository at this point in the history
  • Loading branch information
polymorpher committed Nov 12, 2023
1 parent baa3b3b commit c76aa74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion voice/relay/deploy/enable.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/node
sudo cp voice-ai-relay.service /etc/systemd/system/voice-ai-relay.service
sudo systemctl start voice-ai-relay
sudo systemctl restart voice-ai-relay
sudo systemctl enable voice-ai-relay
systemctl status voice-ai-relay
5 changes: 5 additions & 0 deletions voice/voice-ai/x/AppConfigration/AppConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ class AppConfig {

init() {
self.loadConfiguration()
if openaiKey != nil && openaiKey != "" {
// if a local key is assigned (for debugging), do not request from server
return
}
Task {
await self.requestOpenAIKey()
}
Expand Down Expand Up @@ -113,6 +117,7 @@ class AppConfig {

self.themeName = dictionary["THEME_NAME"]
self.deepgramKey = dictionary["DEEPGRAM_KEY"]
self.openaiKey = dictionary["API_KEY"]

// Convert the string values to Int
if let eventsString = dictionary["MINIMUM_SIGNIFICANT_EVENTS"],
Expand Down

0 comments on commit c76aa74

Please sign in to comment.