From ee0bc0a377c00404c9ca8381e02ae05e3fac0f3d Mon Sep 17 00:00:00 2001 From: Sylvie Crowe <107814465+oneirocosm@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:12:26 -0700 Subject: [PATCH] Windows Bug Fixes (#281) Fixes two bugs - ai component now works on windows - forces files to use lf line endings on windows instead of crlf --- .gitattributes | 1 + frontend/app/view/waveai/waveai.tsx | 1 - frontend/types/gotypes.d.ts | 1 - pkg/wconfig/settingsconfig.go | 10 ---------- 4 files changed, 1 insertion(+), 12 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..fbd75d33 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=lf \ No newline at end of file diff --git a/frontend/app/view/waveai/waveai.tsx b/frontend/app/view/waveai/waveai.tsx index bbbd9f70..3ffe2890 100644 --- a/frontend/app/view/waveai/waveai.tsx +++ b/frontend/app/view/waveai/waveai.tsx @@ -163,7 +163,6 @@ export class WaveAiModel implements ViewModel { const newPrompt: OpenAIPromptMessageType = { role: "user", content: text, - name: globalStore.get(atoms.settingsConfigAtom).ai.name, }; let temp = async () => { const history = await this.fetchAiData(); diff --git a/frontend/types/gotypes.d.ts b/frontend/types/gotypes.d.ts index f8c33a1d..c2c7680f 100644 --- a/frontend/types/gotypes.d.ts +++ b/frontend/types/gotypes.d.ts @@ -9,7 +9,6 @@ declare global { type AiConfigType = { baseurl: string; apitoken: string; - name: string; model: string; maxtokens: number; timeoutms: number; diff --git a/pkg/wconfig/settingsconfig.go b/pkg/wconfig/settingsconfig.go index dbd37221..f05d649f 100644 --- a/pkg/wconfig/settingsconfig.go +++ b/pkg/wconfig/settingsconfig.go @@ -4,7 +4,6 @@ package wconfig import ( - "os/user" "path/filepath" "github.com/wavetermdev/thenextwave/pkg/waveobj" @@ -36,7 +35,6 @@ type WebConfigType struct { type AiConfigType struct { BaseURL string `json:"baseurl"` ApiToken string `json:"apitoken"` - Name string `json:"name"` Model string `json:"model"` MaxTokens uint32 `json:"maxtokens"` TimeoutMs uint32 `json:"timeoutms"` @@ -262,16 +260,8 @@ func applyDefaultSettings(settings *SettingsConfigType) { IntervalMs: 3600000, } } - var userName string - currentUser, err := user.Current() - if err != nil { - userName = "user" - } else { - userName = currentUser.Username - } if settings.Ai == nil { settings.Ai = &AiConfigType{ - Name: userName, Model: "gpt-3.5-turbo", MaxTokens: 1000, TimeoutMs: 10 * 1000,