Dears, Good Afternoon,
Hope you are doing great !
I am using the AI plugin and currently using gemini model for both generative language and embeddings. However after some changes on google side it seems, there seem to be some errors for Discourse forum to reach gemini API - I am struggling to get my forum reach gemini for embeddings.
Embedding configurations
I used to have the following url in the configuration of the model for embeddings using gemini (but I got errors) :
https://generativelanguage.googleapis.com/v1beta/models/gemini-embedding-001:embedContent
Looking at documentation in internet, I found that the url should be instead following a pattern like:
https://{zone}-aiplatform.googleapis.com/v1/projects/{google cloud project reference}/locations/{zone}/publishers/google/models/gemini-embedding-001:embedContent
How the issue is materializing on my side
- I get the following errors:
Trying to contact the model returned this error: { "error": { "code": 401, "message": "API keys are not supported by this API. Expected OAuth2 access token or other authentication credentials that assert a principal. See https://cloud.google.com/docs/authentication", "status": "UNAUTHENTICATED", "details": \[ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "CREDENTIALS_MISSING", "domain": "googleapis.com", "metadata": { "method": "google.cloud.aiplatform.v1.PredictionService.EmbedContent", "service": "aiplatform.googleapis.com" } } \] } } - Newly created topics do not have embedding I presume and therefore instead of “Related topics” AI powered section after the post, the section is instead " New & Unread Topics" - only for the newly created topics since I get errors.
This suggest that we might need to pass more than just an API key ? I am a bit lost.
Additional information
- I have a working google cloud project since the API I am using for generative content (summarize topics, chatbot etc.) work perfectly well on my forum - my issue is only for the embeddings.
- I am using the same API for generative content and the embedding - after some changes on google side, it seems the only API available is “Gemini API” for all models.
- I might have found an article that talks about this (not sure if it is 100% related) :Gemini CLI Vertex AI Authentication Bug - CREDENTIALS_MISSING Despite Valid Service Account · Issue #15823 · google-gemini/gemini-cli · GitHub
My questions
- Is there anything I am missing ?
- Anyone has AI working with gemini models and had to change their configuration using service principals ?
- What is the right Embeddings service URL to use for gemini embedding models ?
Thanks a lot for your precious help and advices.
Cheers.