k8sgpt
k8sgpt copied to clipboard
feat: add azure openai provider
Closes https://github.com/k8sgpt-ai/k8sgpt/issues/117
📑 Description
This PR introduces azure openai and get viper to omit empty strings when writing to config files
✅ Checks
- [x] My pull request adheres to the code style of this project
- [ ] My code requires changes to the documentation
- [ ] I have updated the documentation as required
- [x] All the tests have passed
ℹ Additional Information
Hello @arbreezy , shouldn't we update the README to indicate that we have a new AI Backend available?
Hello @arbreezy , shouldn't we update the README to indicate that we have a new AI Backend available?
Yes we will add docs, I just didn't have much time yesterday; I want to test it as well before merging.
Tried it out, and my first observation is that the help text needs to updated to reflect these changes. I had to check the code to find out what to define as the backend.
Secondly, and this might be out of scope for the actual implementation, but if I want to do an analysis with the Azure OpenAI backend after I have authenticated, I would have so explicitly state that I'm using that as a backend, even when I have no other backends in my configuration file. @AlexsJones, this is probably something we can look into in another issue, right?
Third, and more importantly, I get an error when I run analyze with explain. This is the commands I ran:
> go run . auth -u https://rsopenaigptdemo.openai.azure.com/ -e rsk8sgpt -b azureopenai
Using azureopenai as backend AI provider
Enter azureopenai Key: Provider updated
key added
> go run . analyse -b azureopenai -e
0% | | (0/3, 0 it/hr) [0s:0s]
Error: failed while calling AI provider azureopenai: Post "/openai/deployments//chat/completions?api-version=2023-03-15-preview": unsupported protocol scheme ""
exit status 1
Tried it out, and my first observation is that the help text needs to updated to reflect these changes. I had to check the code to find out what to define as the backend.
Secondly, and this might be out of scope for the actual implementation, but if I want to do an analysis with the Azure OpenAI backend after I have authenticated, I would have so explicitly state that I'm using that as a backend, even when I have no other backends in my configuration file. @AlexsJones, this is probably something we can look into in another issue, right?
Third, and more importantly, I get an error when I run analyze with explain. This is the commands I ran:
> go run . auth -u https://rsopenaigptdemo.openai.azure.com/ -e rsk8sgpt -b azureopenai Using azureopenai as backend AI provider Enter azureopenai Key: Provider updated key added > go run . analyse -b azureopenai -e 0% | | (0/3, 0 it/hr) [0s:0s] Error: failed while calling AI provider azureopenai: Post "/openai/deployments//chat/completions?api-version=2023-03-15-preview": unsupported protocol scheme "" exit status 1
hello @roberthstrand,
Documentation has been added along with some basic checks when running k8sgpt auth
to ensure you will use a valid ai provider/backend.
Could you please run again a test with your Azure OpenAI deployment ?
Re: the analyze cli , I will address it, in a different PR; I agree there is no need to specify a backend if it's the only one in your configuration
Thanks in advance :) !
ready for review?
ready for review?
yes !
is there any documentation change required for this for end users ? wanted to validate this once with my azure openai account .