mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
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
This commit is contained in:
@@ -0,0 +1 @@
|
||||
* text=lf
|
||||
@@ -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();
|
||||
|
||||
Vendored
-1
@@ -9,7 +9,6 @@ declare global {
|
||||
type AiConfigType = {
|
||||
baseurl: string;
|
||||
apitoken: string;
|
||||
name: string;
|
||||
model: string;
|
||||
maxtokens: number;
|
||||
timeoutms: number;
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user