mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-20 11:33:02 +02:00
Ensure the AiCompletionEndpoint field is always initialized
This commit is contained in:
@@ -232,9 +232,6 @@ func handleUpgradedFeatures() error {
|
|||||||
// AI completion is not yet configured, disable it for upgrades since this is a new feature
|
// AI completion is not yet configured, disable it for upgrades since this is a new feature
|
||||||
config.AiCompletion = false
|
config.AiCompletion = false
|
||||||
}
|
}
|
||||||
if config.AiCompletionEndpoint == "" {
|
|
||||||
config.AiCompletionEndpoint = "https://api.openai.com/v1/chat/completions"
|
|
||||||
}
|
|
||||||
return hctx.SetConfig(&config)
|
return hctx.SetConfig(&config)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -274,6 +274,9 @@ func GetConfig() (ClientConfig, error) {
|
|||||||
if config.ColorScheme.BorderColor == "" {
|
if config.ColorScheme.BorderColor == "" {
|
||||||
config.ColorScheme.BorderColor = GetDefaultColorScheme().BorderColor
|
config.ColorScheme.BorderColor = GetDefaultColorScheme().BorderColor
|
||||||
}
|
}
|
||||||
|
if config.AiCompletionEndpoint == "" {
|
||||||
|
config.AiCompletionEndpoint = "https://api.openai.com/v1/chat/completions"
|
||||||
|
}
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user