Open Ai Port (#154)

This brings over a simplified version of the open ai feature from the
previous app but in widget form. It still needs some work to reach
parity with that version, but this includes all of the basic building
blocks to get that working.
This commit is contained in:
Sylvie Crowe
2024-07-25 02:30:49 -07:00
committed by GitHub
parent dcb4d5f2bf
commit 0e46b79c22
13 changed files with 576 additions and 134 deletions
+9
View File
@@ -4,6 +4,7 @@
package wconfig
import (
"os/user"
"path/filepath"
"github.com/wavetermdev/thenextwave/pkg/wavebase"
@@ -141,6 +142,13 @@ func applyDefaultSettings(settings *SettingsConfigType) {
IntervalMs: 3600000,
}
}
var userName string
currentUser, err := user.Current()
if err != nil {
userName = "user"
} else {
userName = currentUser.Username
}
defaultWidgets := []WidgetsConfigType{
{
Icon: "files",
@@ -170,6 +178,7 @@ func applyDefaultSettings(settings *SettingsConfigType) {
Label: "waveai",
BlockDef: wstore.BlockDef{
View: "waveai",
Meta: map[string]any{"name": userName, "baseurl": "", "apitoken": ""},
},
},
}