A language model client interface establishes one contract for invoking multiple providers while keeping provider-specific communication behind SDK-backed implementations. section 6.4.3
A practical contract exposes:
- A provider identifier, such as openai or gemini. section 6.4.3
- A readiness check indicating whether the client is configured and usable. section 6.4.3
- A text-generation operation accepting an application prompt. section 6.4.3
- Configuration-based provider selection, without silently switching providers after request failures. section 6.4.3
Configuration default versus runtime fallback
An application can default to OpenAI when ai.provider is absent, while explicitly selecting Gemini through configuration. If the selected provider fails, the request errors instead of switching providers and contaminating benchmark results. section 6.4.3
Listing 6.20 Setting the Gemini API properties
google:
ai:
api:
key: ${GOOGLE_AI_API_KEY:}
model: ${GOOGLE_AI_MODEL:gemini-2.5-flash} #A
Inspect the Gemini API-key and model configuration used by the provider-specific client. section 6.4.3
