Class GeminiProvider
java.lang.Object
ai.doctruth.GeminiProvider
- All Implemented Interfaces:
LlmProvider
Google Gemini
generateContent provider. Per ADR 0003 the vendor SDK is NOT on the
classpath; this class is a thin facade that delegates to a hand-rolled
GeminiHttpClient (JDK HttpClient + Jackson + Failsafe via
RetryGate).
non-sealed so test code (and advanced users) can anonymously subclass to
supply canned responses or wrap behaviour.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionGeminiProvider(String apiKey) Production constructor — talks togenerativelanguage.googleapis.com.GeminiProvider(String apiKey, URI endpoint, String model) Test / advanced-user constructor: point at an alternative base URL (e.g. -
Method Summary
Modifier and TypeMethodDescriptionapiKey()complete(ProviderRequest request) Execute one extraction call against the provider.name()Logical lower-case name of the provider, e.g.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface LlmProvider
region
-
Constructor Details
-
GeminiProvider
Production constructor — talks togenerativelanguage.googleapis.com. -
GeminiProvider
Test / advanced-user constructor: point at an alternative base URL (e.g. WireMock) or pin a specific model id.- Parameters:
apiKey- Gemini API key; non-null and non-blank.endpoint- base URL for the API (the client appends/v1beta/models/{model}:generateContent); non-null.model- Gemini model id; non-null and non-blank.
-
-
Method Details
-
apiKey
-
name
Description copied from interface:LlmProviderLogical lower-case name of the provider, e.g."anthropic". Recorded intoProvenance.model()on everyExtractionResult.- Specified by:
namein interfaceLlmProvider
-
complete
Description copied from interface:LlmProviderExecute one extraction call against the provider.- Specified by:
completein interfaceLlmProvider- Parameters:
request- the prepared request; never null.- Returns:
- the provider's raw JSON response and usage metadata.
- Throws:
ProviderException- on transport, schema, or upstream failure.
-