-
Notifications
You must be signed in to change notification settings - Fork 612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: analyze`s --backend arg error #902
Comments
Hi, can I work on this? |
@VaibhavMalik4187 sure |
It looks like this behaviour is intentional and was introduced by @AlexsJones in the commit cbe2fb4. @AlexsJones, in #427 (comment), I don't think that the code matches the reasoning. Like, in this case, the backend has been specified as openai and the default backend is also set. But the default backend is being used because it satisfies the following condition and sets the backend to use the default backend: if configAI.DefaultProvider != "" && backend == "openai" {
backend = configAI.DefaultProvider
} |
Changing the default value of the if configAI.DefaultProvider == "" && backend == "" {
backend = "openai"
} else if configAI.DefaultProvider != "" && backend == "" {
backend = configAI.DefaultProvider
} Fixes the issue, would like to know your thoughts on this @AlexsJones, @JuHyung-Son. Thanks! |
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: k8sgpt-ai#902 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
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: k8sgpt-ai#902 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
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: k8sgpt-ai#902 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
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: k8sgpt-ai#902 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
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: #902 Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com> Co-authored-by: JuHyung Son <sonju0427@gmail.com>
Checklist
Affected Components
K8sGPT Version
No response
Kubernetes Version
No response
Host OS and its Version
No response
Steps to reproduce
2 problems.
Expected behaviour
ai provider should be provided
--backend
evenopenai
is given.Actual behaviour
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: