Package org.egothor.methodatlas.ai
Class AiOptions.Builder
java.lang.Object
org.egothor.methodatlas.ai.AiOptions.Builder
- Enclosing class:
AiOptions
Mutable builder used to construct validated
AiOptions instances.
The builder follows the conventional staged construction pattern, allowing
optional parameters to be supplied before producing the final immutable
configuration record via build().
Reasonable defaults are provided for most parameters so that only provider-specific details typically need to be configured explicitly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the API key used for authentication.Specifies the environment variable that stores the API key.Sets the base API endpoint used by the provider.build()Builds the final immutableAiOptionsconfiguration.confidence(boolean confidence) Enables or disables AI confidence scoring.enabled(boolean enabled) Enables or disables AI enrichment.maxClassChars(int maxClassChars) Sets the maximum size of class source submitted to the AI provider.maxRetries(int maxRetries) Sets the retry limit for AI requests.Specifies the provider-specific model identifier.provider(AiProvider provider) Selects the AI provider.taxonomyFile(Path taxonomyFile) Specifies an external taxonomy definition file.taxonomyMode(AiOptions.TaxonomyMode taxonomyMode) Selects the built-in taxonomy mode.Sets the timeout applied to AI requests.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
enabled
Enables or disables AI enrichment.- Parameters:
enabled-trueto enable AI integration- Returns:
- this builder
-
provider
Selects the AI provider.- Parameters:
provider- provider implementation to use- Returns:
- this builder
-
modelName
Specifies the provider-specific model identifier.- Parameters:
modelName- name of the model to use- Returns:
- this builder
-
baseUrl
Sets the base API endpoint used by the provider.- Parameters:
baseUrl- base URL of the provider API- Returns:
- this builder
-
apiKey
Sets the API key used for authentication.- Parameters:
apiKey- API key value- Returns:
- this builder
-
apiKeyEnv
Specifies the environment variable that stores the API key.- Parameters:
apiKeyEnv- environment variable name- Returns:
- this builder
-
taxonomyFile
Specifies an external taxonomy definition file.- Parameters:
taxonomyFile- path to taxonomy definition- Returns:
- this builder
-
taxonomyMode
Selects the built-in taxonomy mode.- Parameters:
taxonomyMode- taxonomy variant- Returns:
- this builder
-
maxClassChars
Sets the maximum size of class source submitted to the AI provider.- Parameters:
maxClassChars- maximum allowed character count- Returns:
- this builder
-
timeout
Sets the timeout applied to AI requests.- Parameters:
timeout- request timeout- Returns:
- this builder
-
maxRetries
Sets the retry limit for AI requests.- Parameters:
maxRetries- retry count- Returns:
- this builder
-
confidence
Enables or disables AI confidence scoring.When enabled, the prompt instructs the AI provider to return a
confidencevalue for each method classification. The value is included in the output as anai_confidencecolumn.- Parameters:
confidence-trueto request confidence scores- Returns:
- this builder
-
build
Builds the final immutableAiOptionsconfiguration.If no base URL is explicitly supplied, a provider-specific default endpoint is selected automatically.
- Returns:
- validated AI configuration
-