-
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
feat: added Google GenAI client; simplified IAI/clients API surface. #829
Conversation
Signed-off-by: bwplotka <bwplotka@gmail.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #829 +/- ##
==========================================
- Coverage 46.54% 45.87% -0.67%
==========================================
Files 27 27
Lines 2198 2230 +32
==========================================
Hits 1023 1023
- Misses 1137 1169 +32
Partials 38 38 ☔ View full report in Codecov by Sentry. |
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.
Great work thanks @bwplotka.
Lgtm although I can't test the new backend.
One minor thing, our semantic PR validation fails if you have a capital letter after the prefix.
Done, thanks! |
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.
Thank you @bwplotka for your contribution ! Good job ! Shouldn't we add an example in the readme? https://github.com/k8sgpt-ai/k8sgpt/blob/main/README.md#key-features
Yup, I can do that in later PR or this one, up to you. Tomorrow though, closing laptop for today! |
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
Please open a new PR for the docs Thank you for this contribution! |
Thanks! Docs in progress 💪🏽 |
📑 Description
Disclaimer: I am not a GenAI experts, or official Google delegate around those topics. I know what you know from public docs (: I am simply contributing some improvements here as I experiment with the OSS tooling around analyzing Kubernetes problems. Thought I could improve some CNCF software on the way.
This PR adds the newest https://ai.google.dev/ API (for Gemini and PaLM (legacy) models).
I think it might be fixing #799, since the Gemini API added here is also supported by Google Cloud Vertex AI but there is no Vertex AI client/API per se (AFAIK), there was only PaLM APIs, so not sure. Sorry @swastik959 if I accidentally solved the issue you were assigned to. I had to do this work anyway for my experiments.
On the way I couldn't understand why
IAI
interface is so complex. After investigation it seems it might be some tech debt from initial experiments, I proposed some changes to limit code duplication, improve readability and consistency (and fixed some gaps on the way). Specifically:add auth
flags specify which backend cares about which settingsgetAIResultForSanitizedFailures
function. Thanks of thatGenerateComplete
is trvial andParse
can be removed.language
. Current code only tries to force language with prompt prefix, so no need to inject it (we can inject later if needed). This simplifiesConfigure
method.✅ Checks
ℹ Additional Information
Gemini API is still rolling out e.g. it's not available in UK yet 🙈 Full details: https://ai.google.dev/available_regions