Standardize Gemini Authentication #1401
Conversation
✅ Deploy Preview for adk-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
joefernandez
left a comment
There was a problem hiding this comment.
Thanks for taking a pass at this. It's helped me understand the teaching problem, here and made it clear how we should solve it.
| [Context caching](/adk-docs/context/caching/), | ||
| [Computer use](/adk-docs/tools/gemini-api/computer-use/) | ||
| and the [Interactions API](#interactions-api). | ||
| There are two primary APIs for accessing the Gemini model family: [Vertex AI API](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview) (available via Google Cloud Console) and the [Gemini API](https://ai.google.dev/gemini-api/docs) (available via Google AI Studio). While both provide access to the same state-of-the-art models, the choice between them depends on your specific security requirements, development phase, and deployment environment. |
There was a problem hiding this comment.
this is not an appropriate way to introduce the Gemini model family. This intro is WAY over-indexed on access path choices, to the point its getting in the way of the purpose of this page. This content should bet pushed down the page into a section that talks about access models, similar to the existing Gemini model authentication https://google.github.io/adk-docs/agents/models/google-gemini/#gemini-model-authentication
| ## Gemini model authentication | ||
|
|
||
| This section covers authenticating with Google's Gemini models, either through Google AI Studio for rapid development or Google Cloud Vertex AI for enterprise applications. This is the most direct way to use Google's flagship models within ADK. | ||
| ## Choosing Vertex AI API or Gemini API {#choosing-api} |
There was a problem hiding this comment.
This whole section feels like a sales pitch for Vertex AI API and Gemini. One of the promises of ADK as a framework is that it is open to use for all models. Its fine to provide some brief insights into why someone might want to use these products, but leave the sales job to the marketing pages for those products, it's not appropriate for technical documentation, and it will turn off developers who are looking for technical information
| and the [Interactions API](#interactions-api). | ||
| There are two primary APIs for accessing the Gemini model family: [Vertex AI API](https://cloud.google.com/vertex-ai/generative-ai/docs/learn/overview) (available via Google Cloud Console) and the [Gemini API](https://ai.google.dev/gemini-api/docs) (available via Google AI Studio). While both provide access to the same state-of-the-art models, the choice between them depends on your specific security requirements, development phase, and deployment environment. | ||
|
|
||
| ## Get started |
There was a problem hiding this comment.
Moving getting started section to the end is completely antithetical to the purpose of this page. At the end of the day developers want to know how to put a model into an agent. Burying that at the end is not appropriate
| @@ -0,0 +1,54 @@ | |||
| Gemini Interactions API {#interactions-api} | |||
There was a problem hiding this comment.
I'm a not huge fan of splitting this out, because it makes is look like Gemini Interactions API is a model itself, rather that what it is, which is just an API option.
IF we were going to do this, the split should be:
/models/gemini/index.md
/models/gemini/interactions.md
so we can easily count the traffic to these pages together in Google Analytics
| Ensure your environment is configured for Vertex AI: | ||
|
|
||
| 1. **Authentication:** Use Application Default Credentials (ADC): | ||
| --8<-- "docs/_snippets/gemini-authentication.md" |
There was a problem hiding this comment.
Duplication of GCP setup: Solving the duplication of GCP setup content by automating the content duplication is not what I had in mind.
Ideally, we want to minimize this information, because that's not what readers are here for. Also, once you get GCP access setup once, it's not something you have to keep doing. So, we concentrate that information in a single place and beef it up, and then point all docs that need that information to that location. Furthermore there is reason to believe that chopping up this content into small bits will make it harder for AI consumers to process it as useful context.
| @@ -0,0 +1,52 @@ | |||
| # ADK roubleshooting guide | |||
There was a problem hiding this comment.
I disagree with this decision to separate this information from the Gemini model content. It's extremely unlikely we will ever pursue building a troubleshooting guide for ADK; in a nutshell, that is an unsupportable exercise from a resource perspective.
Furthermore, such guides are now irrelevant because AI coding tools are much, MUCH better at troubleshooting.
| - TypeScript: get-started/typescript.md | ||
| - Go: get-started/go.md | ||
| - Java: get-started/java.md | ||
| - Troubleshooting: get-started/troubleshooting.md |
| - Ollama: agents/models/ollama.md | ||
| - vLLM: agents/models/vllm.md | ||
| - LiteLLM: agents/models/litellm.md | ||
| - LiteLLM: agents/models/litellm.md |
There was a problem hiding this comment.
remove trailing spaces
| - Models for Agents: | ||
| - agents/models/index.md | ||
| - Gemini: agents/models/google-gemini.md | ||
| - Gemini Interactions: agents/models/gemini-Interactions.md |
There was a problem hiding this comment.
we need to discuss details, but this will need to change
|
|
||
| #### Google Cloud Prerequisites {#setup-cloud-project} | ||
|
|
||
| 1. **Sign into Google Cloud**: |
There was a problem hiding this comment.
This information needs to get concentrated in a specific location, rather than being buried in the Gemini page, because every GCP product that integrates with ADK has this process as a prerequisite.
|
Closing using an alternative implementation: |
The goal of this PR is to consolidate Gemini authentication into reusable snippets and update the most common guides to use a centralized authentication pattern. It also adds specific guidance for selecting between Vertex AI and the Gemini API, resolving developer confusion caused by inconsistent setup instructions across the site.
Summary of Changes
google-gemini.md,python.md,quickstart.md, andconfig.mdwith pointers to the new snippets.google-gemini.mdto help users decide between AI Studio and Vertex AI.MkDocs Maintenance:
navconfiguration to include the new Interactions and Troubleshooting pages._snippets/directory from the site build to prevent rendering issues.Verification
mkdocs servewith zero build warnings.