Class GoogleAdapter
java.lang.Object
com.axelor.ai.provider.sync.adapter.GoogleAdapter
- All Implemented Interfaces:
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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfetch(AiProvider provider, ModelListFetcher http) Fetches and normalises the vendor's model list.type()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.axelor.ai.provider.sync.ProviderAdapter
baseUrl, requireApiKey
-
Constructor Details
-
GoogleAdapter
public GoogleAdapter()
-
-
Method Details
-
type
- Specified by:
typein interfaceProviderAdapter
-
fetch
Description copied from interface:ProviderAdapterFetches and normalises the vendor's model list.- Specified by:
fetchin interfaceProviderAdapter
-