mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-21 16:38:23 +01: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:
parent
7d90a3912b
commit
ee0bc0a377
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -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();
|
||||
|
1
frontend/types/gotypes.d.ts
vendored
1
frontend/types/gotypes.d.ts
vendored
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user