-
Notifications
You must be signed in to change notification settings - Fork 721
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
fix: disable adding multiple openai provider #1191
Conversation
/cc @AlexsJones |
gyliu@guangyas-air k8sgpt % ./bin/k8sgpt auth add
Warning: backend input is empty, will use the default value: openai
Warning: model input is empty, will use the default value: gpt-3.5-turbo
Enter openai Key: openai added to the AI backend provider list gyliu@guangyas-air k8sgpt % ./bin/k8sgpt auth add
Warning: backend input is empty, will use the default value: openai
Warning: model input is empty, will use the default value: gpt-3.5-turbo
Enter openai Key: Provider with same name already exists. gyliu@Guangyas-MacBook-Air k8sgpt % cat k8sgpt.yaml
active_filters:
- ValidatingWebhookConfiguration
- Deployment
- PersistentVolumeClaim
- InstanaSelfHostedInstallCheck
- StatefulSet
- CronJob
- ReplicaSet
- Service
- Node
- MutatingWebhookConfiguration
- InstanaSelfHostedValidate
- Ingress
- Pod
ai:
providers:
- name: openai
model: gpt-3.5-turbo
password: "123456"
temperature: 0.7
topp: 0.5
topk: 50
maxtokens: 2048
customheaders: []
defaultprovider: ""
kubeconfig: ""
kubecontext: "" |
Can you help me understand this issue? |
@AlexsJones if you take a look at https://github.com/k8sgpt-ai/k8sgpt/blob/main/cmd/auth/add.go#L64 , you will see the |
your intend is to make disabling auth add if there is existing one. right? |
@JuHyung-Son This is the design behavior for all other LLM backends, I was trying to enable this behavior for openai as well. |
@AlexsJones @JuHyung-Son any further comments for this? Thanks! |
Hi @gyliu513 ! I just tested it, and it works well. However, the CLI still prompts me to enter an API key before returning an error, since the backend already exists. Shouldn't we perform this check before displaying the |
Signed-off-by: Guangya Liu <[email protected]>
@matthisholleville done gyliu@Guangyas-MacBook-Air k8sgpt % ./bin/k8sgpt auth add
Warning: backend input is empty, will use the default value: openai
Provider with same name already exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm ! Great work
Signed-off-by: Guangya Liu <[email protected]> Co-authored-by: Matthis <[email protected]> Signed-off-by: AlexsJones <[email protected]>
Closes #1169
π Description
β Checks
βΉ Additional Information