Class HardcodedGeminiModel
GeminiModel that uses hardcoded metadata instead of
fetching it from the Gemini API. This is useful for restricted environments
like "Google Vertex Express" which do not support model discovery (listing).- Author:
- anahata
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe human-readable name for this model.private IntegerThe maximum number of input tokens supported by this specific hardcoded manifest.private IntegerThe maximum number of output tokens supported by this specific hardcoded manifest.The list of API actions (e.g.private StringThe version string for the hardcoded model manifest.Fields inherited from class AbstractModel
tokenizerType -
Constructor Summary
ConstructorsConstructorDescriptionHardcodedGeminiModel(GeminiAiProvider provider, String modelId) Constructs a new hardcoded model instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the default temperature for this model.Gets the default topK for this model.Gets the default topP for this model.Gets a detailed description of the model's capabilities and limitations.Gets the human-readable display name for this model.Gets the maximum number of input tokens supported by this model.Gets the maximum number of output tokens this model can generate in a single turn.Gets a rich, potentially HTML-formatted description of the model, including all its metadata.Gets the list of supported API actions for this model (e.g., "generateContent").Gets the version string for this model.Methods inherited from class GeminiModel
countTokens, countTokens, countTokens, countTokens, generateContent, generateContentStream, getAvailableServerTools, getDefaultServerTools, getModelId, getProvider, getSupportedResponseModalities, getToolDeclarationJson, isSupportsBatchEmbeddings, isSupportsCachedContent, isSupportsContentGeneration, isSupportsEmbeddings, isSupportsFunctionCalling, toStringMethods inherited from class AbstractModel
getProviderId, getTokenizerType
-
Field Details
-
displayName
The human-readable name for this model. Used when the API cannot provide metadata (e.g. Vertex Express). -
version
The version string for the hardcoded model manifest. -
maxInputTokens
The maximum number of input tokens supported by this specific hardcoded manifest. -
maxOutputTokens
The maximum number of output tokens supported by this specific hardcoded manifest. -
supportedActions
-
-
Constructor Details
-
HardcodedGeminiModel
Constructs a new hardcoded model instance.- Parameters:
provider- The owning Gemini provider.modelId- The unique model identifier.
-
-
Method Details
-
getDisplayName
Gets the human-readable display name for this model.Returns the hardcoded display name.
- Overrides:
getDisplayNamein classGeminiModel- Returns:
- The display name.
-
getVersion
Gets the version string for this model.Returns the hardcoded version string.
- Overrides:
getVersionin classGeminiModel- Returns:
- The version.
-
getMaxInputTokens
Gets the maximum number of input tokens supported by this model.Returns the hardcoded input token limit.
- Overrides:
getMaxInputTokensin classGeminiModel- Returns:
- The input token limit, or null if unspecified/unknown by provider.
-
getMaxOutputTokens
Gets the maximum number of output tokens this model can generate in a single turn.Returns the hardcoded output token limit.
- Overrides:
getMaxOutputTokensin classGeminiModel- Returns:
- The output token limit, or null if unspecified/unknown by provider.
-
getSupportedActions
Gets the list of supported API actions for this model (e.g., "generateContent").Returns the hardcoded list of supported actions.
- Overrides:
getSupportedActionsin classGeminiModel- Returns:
- A list of supported actions.
-
getDefaultTemperature
Gets the default temperature for this model.Temperature controls the randomness of the response. Higher values (e.g., 1.0) make the output more random, while lower values (e.g., 0.2) make it more deterministic.
Returns null as the default temperature.
- Overrides:
getDefaultTemperaturein classGeminiModel- Returns:
- The default temperature, or null if not specified.
-
getDefaultTopK
Gets the default topK for this model.Top-K sampling limits the model's choices to the K most likely next tokens.
Returns null as the default topK.
- Overrides:
getDefaultTopKin classGeminiModel- Returns:
- The default topK, or null if not specified.
-
getDefaultTopP
Gets the default topP for this model.Top-P (nucleus) sampling selects tokens whose cumulative probability adds up to the threshold P.
Returns null as the default topP.
- Overrides:
getDefaultTopPin classGeminiModel- Returns:
- The default topP, or null if not specified.
-
getDescription
Gets a detailed description of the model's capabilities and limitations.Returns a simple description for hardcoded models.
- Overrides:
getDescriptionin classGeminiModel- Returns:
- The model description.
-
getRawDescription
Gets a rich, potentially HTML-formatted description of the model, including all its metadata.Implementation details: Escapes special HTML characters in the model metadata to ensure safe rendering in the NetBeans HTML view.
Returns a basic metadata summary for the model.
- Overrides:
getRawDescriptionin classGeminiModel- Returns:
- The raw description string.
-

