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:
Sylvie Crowe 2024-08-27 15:12:26 -07:00 committed by GitHub
parent 7d90a3912b
commit ee0bc0a377
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1 additions and 12 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
* text=lf

View File

@ -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();

View File

@ -9,7 +9,6 @@ declare global {
type AiConfigType = {
baseurl: string;
apitoken: string;
name: string;
model: string;
maxtokens: number;
timeoutms: number;

View File

@ -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,