Closed JuHyung-Son closed 8 months ago
Hi, can I work on this?
@VaibhavMalik4187 sure
It looks like this behaviour is intentional and was introduced by @AlexsJones in the commit cbe2fb4a4c160a0a24b3fb4602cae8e5eebd6aa0.
@AlexsJones, in https://github.com/k8sgpt-ai/k8sgpt/pull/427#discussion_r1194874035, 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 backend
flag to ""
and updating the if condition to:
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!
Checklist
Affected Components
K8sGPT Version
No response
Kubernetes Version
No response
Host OS and its Version
No response
Steps to reproduce
2 problems.
set default backend as none openai and give -b openai -> use default backend not openai
set any default backend and run analyze with -b arg -> only use default backend not provided arg. (i think this is bug)
Expected behaviour
ai provider should be provided
--backend
evenopenai
is given.Actual behaviour
No response
Additional Information
No response