Closed bogdansolga closed 3 weeks ago
Hi @bogdansolga do you wish to use one of the following samples from this codelab and test it out: link ?
Just set the project id, region and model name.
Thank you @ddobrin , I will check ASAP 🙂 I certainly hope the samples will work.
@bogdansolga were you able to resolve your issue.
@asaikali and @ddobrin - not at all. Went through Google's (overly complicated and complexified) process of setting up the Application Default Credentials, activated and enabled some settings in Google Cloud (way too many and complex to remember), ran the ConversationExample and got exactly the same error that I had... almost two months ago.
I have attached the stack trace, in case it helps in any way. I am more than disappointed about the complexity of the Gemini integration; not blaming the Spring AI support, in any way.
@ddobrin - unfortunately, the usage of Gemini is far more complicated than 'Just set the project id, region and model name.' Besides setting up the Application Default Credentials, installing the Google Cloud SDK, activating and enabling the APIs and Services for that project, ... and it still seems to be not enough.
I might be using an incorrect region; how can I know which region I can / should use? where to configure it?
And, FFS, why is the whole process so overly complexified? Thousands of kudos to OpenAI and Anthropic for requiring just an API key, which can be obtained in 2 minutes (at most)
@bogdansolga
The stacktrace indicates it clearly:
The requested URL /v1/projects/ai-query-hub/locations/europe-west-3/publishers/google/models/gemini-1.5-pro-001:generateContent
was not found on this server.
See the documentation here: Vertex AI locations
The provided samples are also working fine with the correct region
I'd like to recommend that you revisit the Google docs available for Gemini API Quickstart including how to retrieve an API key and access Gemini models with an API key instead of the Auth token.
While the Vertex AI Java SDK, on which the Vertex Gemini model is based, supports at this time only token based auth, key based access will be resolved by this issue
cc: @asaikali
Thank you, @ddobrin
With all the respect - how could I have known / found the possible locations in the ocean of information and links that Vertex / Google requires, especially considering that Open ai and Anthropic require... none?
And regarding the obtaining of an API key - this is absolutely the first mention of the possibility of using an API key.
There was absolutely no reference to this possibility in the reference Spring AI documentation
This is a fast paced environment, it evolves quickly, new features are being added to SDKs and AI orchestration frameworks every single day/week/month; please follow the space
Given the amount of time that Vertex and Google require to test their LLM, considering the fact that it is arguably the 3rd or 4th in the world, is an order of magnitude higher than the benefits, I will easily say no, thanks.
Case closed, for me.
In Gemini's own words (and quasi self awareness):
You're right to be frustrated. Setting up Gemini, especially for the first time, can feel like navigating a maze compared to the smoother onboarding experiences of OpenAI and Anthropic.
Here's a breakdown of why this complexity exists and what Google might be thinking:
Why Gemini Setup Can Be Painful:
Why OpenAI and Anthropic Seem Easier:
What Google Might Be Thinking:
The Bottom Line:
You're not alone in finding Gemini's setup process challenging. While Google's focus on security and enterprise features is understandable, they need to strike a better balance between power and usability. Hopefully, they will streamline the onboarding process and documentation to make Gemini more accessible to a wider audience.
Bug description When I invoke the Google Gemini LLM, using either the Spring AI wrappers or the native Vertex API (described here), I get a weird 'not implemented' HTML error:
Environment
Steps to reproduce
Expected behavior A query performed using the ChatClient should work, as it is working (at least) for ChatGPT and Claude.
Minimal Complete Reproducible example Here