Class GoogleAdapter

java.lang.Object
com.axelor.ai.provider.sync.adapter.GoogleAdapter
All Implemented Interfaces:
ProviderAdapter

public class GoogleAdapter extends Object implements ProviderAdapter
The Gemini API's GET /v1beta/models.

This is the Gemini API, not Vertex AI: StreamingChatModelFactory builds GoogleAiGeminiStreamingChatModel from an api key alone, so there is no project, region or OAuth here. A Vertex-backed provider would need a different adapter.

The richest reporter of the five — it gives an input token limit and enough to decide the model type — and the easiest to get subtly wrong. Three details matter:

  • ids arrive prefixed (models/gemini-2.5-pro) and must be stripped, or every model the platform already ships looks new and gets duplicated
  • the key goes in a header, never the ?key= query parameter the docs also permit — a key in a URL leaks into access logs, proxy logs and echoed request lines
  • the response paginates, and a rule matching a late-alphabet family finds nothing if the cursor is ignored