mirror of
https://github.com/k8sgpt-ai/k8sgpt.git
synced 2026-01-26 13:24:24 +00:00
fix: analyze command default backend bug (#966)
Now, the default value of the `backend` flag for the analyze command will be an empty string. And the `NewAnalysis` function has been modified to use the default backend set by the user if the backend flag is not provided and the `defaultprovider` is set in the config file. Otherwise, backend will be set to "openai". Fixes: https://github.com/k8sgpt-ai/k8sgpt/issues/902 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com> Co-authored-by: JuHyung Son <sonju0427@gmail.com>
This commit is contained in:
@@ -60,6 +60,7 @@ var AnalyzeCmd = &cobra.Command{
|
||||
withDoc,
|
||||
interactiveMode,
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
color.Red("Error: %v", err)
|
||||
os.Exit(1)
|
||||
@@ -124,7 +125,7 @@ func init() {
|
||||
// explain flag
|
||||
AnalyzeCmd.Flags().BoolVarP(&explain, "explain", "e", false, "Explain the problem to me")
|
||||
// add flag for backend
|
||||
AnalyzeCmd.Flags().StringVarP(&backend, "backend", "b", "openai", "Backend AI provider")
|
||||
AnalyzeCmd.Flags().StringVarP(&backend, "backend", "b", "", "Backend AI provider")
|
||||
// output as json
|
||||
AnalyzeCmd.Flags().StringVarP(&output, "output", "o", "text", "Output format (text, json)")
|
||||
// add language options for output
|
||||
|
||||
Reference in New Issue
Block a user