mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +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 = {
|
const newPrompt: OpenAIPromptMessageType = {
|
||||||
role: "user",
|
role: "user",
|
||||||
content: text,
|
content: text,
|
||||||
name: globalStore.get(atoms.settingsConfigAtom).ai.name,
|
|
||||||
};
|
};
|
||||||
let temp = async () => {
|
let temp = async () => {
|
||||||
const history = await this.fetchAiData();
|
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 = {
|
type AiConfigType = {
|
||||||
baseurl: string;
|
baseurl: string;
|
||||||
apitoken: string;
|
apitoken: string;
|
||||||
name: string;
|
|
||||||
model: string;
|
model: string;
|
||||||
maxtokens: number;
|
maxtokens: number;
|
||||||
timeoutms: number;
|
timeoutms: number;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
package wconfig
|
package wconfig
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/user"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/wavetermdev/thenextwave/pkg/waveobj"
|
"github.com/wavetermdev/thenextwave/pkg/waveobj"
|
||||||
@ -36,7 +35,6 @@ type WebConfigType struct {
|
|||||||
type AiConfigType struct {
|
type AiConfigType struct {
|
||||||
BaseURL string `json:"baseurl"`
|
BaseURL string `json:"baseurl"`
|
||||||
ApiToken string `json:"apitoken"`
|
ApiToken string `json:"apitoken"`
|
||||||
Name string `json:"name"`
|
|
||||||
Model string `json:"model"`
|
Model string `json:"model"`
|
||||||
MaxTokens uint32 `json:"maxtokens"`
|
MaxTokens uint32 `json:"maxtokens"`
|
||||||
TimeoutMs uint32 `json:"timeoutms"`
|
TimeoutMs uint32 `json:"timeoutms"`
|
||||||
@ -262,16 +260,8 @@ func applyDefaultSettings(settings *SettingsConfigType) {
|
|||||||
IntervalMs: 3600000,
|
IntervalMs: 3600000,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var userName string
|
|
||||||
currentUser, err := user.Current()
|
|
||||||
if err != nil {
|
|
||||||
userName = "user"
|
|
||||||
} else {
|
|
||||||
userName = currentUser.Username
|
|
||||||
}
|
|
||||||
if settings.Ai == nil {
|
if settings.Ai == nil {
|
||||||
settings.Ai = &AiConfigType{
|
settings.Ai = &AiConfigType{
|
||||||
Name: userName,
|
|
||||||
Model: "gpt-3.5-turbo",
|
Model: "gpt-3.5-turbo",
|
||||||
MaxTokens: 1000,
|
MaxTokens: 1000,
|
||||||
TimeoutMs: 10 * 1000,
|
TimeoutMs: 10 * 1000,
|
||||||
|
Loading…
Reference in New Issue
Block a user