Class HardcodedGeminiModel


public class HardcodedGeminiModel extends GeminiModel
A specialized 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 Details

    • displayName

      private String displayName
      The human-readable name for this model. Used when the API cannot provide metadata (e.g. Vertex Express).
    • version

      private String version
      The version string for the hardcoded model manifest.
    • maxInputTokens

      private Integer maxInputTokens
      The maximum number of input tokens supported by this specific hardcoded manifest.
    • maxOutputTokens

      private Integer maxOutputTokens
      The maximum number of output tokens supported by this specific hardcoded manifest.
    • supportedActions

      private List<String> supportedActions
      The list of API actions (e.g. 'generateContent') supported by this specific hardcoded manifest.
  • Constructor Details

    • HardcodedGeminiModel

      public HardcodedGeminiModel(GeminiAiProvider provider, String modelId)
      Constructs a new hardcoded model instance.
      Parameters:
      provider - The owning Gemini provider.
      modelId - The unique model identifier.
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Gets the human-readable display name for this model.

      Returns the hardcoded display name.

      Overrides:
      getDisplayName in class GeminiModel
      Returns:
      The display name.
    • getVersion

      public String getVersion()
      Gets the version string for this model.

      Returns the hardcoded version string.

      Overrides:
      getVersion in class GeminiModel
      Returns:
      The version.
    • getMaxInputTokens

      public Integer getMaxInputTokens()
      Gets the maximum number of input tokens supported by this model.

      Returns the hardcoded input token limit.

      Overrides:
      getMaxInputTokens in class GeminiModel
      Returns:
      The input token limit, or null if unspecified/unknown by provider.
    • getMaxOutputTokens

      public Integer getMaxOutputTokens()
      Gets the maximum number of output tokens this model can generate in a single turn.

      Returns the hardcoded output token limit.

      Overrides:
      getMaxOutputTokens in class GeminiModel
      Returns:
      The output token limit, or null if unspecified/unknown by provider.
    • getSupportedActions

      public List<String> getSupportedActions()
      Gets the list of supported API actions for this model (e.g., "generateContent").

      Returns the hardcoded list of supported actions.

      Overrides:
      getSupportedActions in class GeminiModel
      Returns:
      A list of supported actions.
    • getDefaultTemperature

      public Float 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:
      getDefaultTemperature in class GeminiModel
      Returns:
      The default temperature, or null if not specified.
    • getDefaultTopK

      public Integer 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:
      getDefaultTopK in class GeminiModel
      Returns:
      The default topK, or null if not specified.
    • getDefaultTopP

      public Float 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:
      getDefaultTopP in class GeminiModel
      Returns:
      The default topP, or null if not specified.
    • getDescription

      public String getDescription()
      Gets a detailed description of the model's capabilities and limitations.

      Returns a simple description for hardcoded models.

      Overrides:
      getDescription in class GeminiModel
      Returns:
      The model description.
    • getRawDescription

      public String 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:
      getRawDescription in class GeminiModel
      Returns:
      The raw description string.