Class AiProviderConfig
java.lang.Object
hudson.model.AbstractDescribableImpl<AiProviderConfig>
io.jenkins.plugins.changeinvestigator.ai.provider.AiProviderConfig
- All Implemented Interfaces:
Describable<AiProviderConfig>,Serializable
- Direct Known Subclasses:
AnthropicProviderConfig,AzureOpenAiProviderConfig,BedrockProviderConfig,GeminiProviderConfig,OllamaProviderConfig,OpenAiCompatibleProviderConfig,OpenAiProviderConfig
public abstract class AiProviderConfig
extends AbstractDescribableImpl<AiProviderConfig>
implements Serializable
One selectable AI provider in the "AI Provider" dropdown (rendered via
f:dropdownDescriptorSelector), holding exactly the non-secret, provider-specific
configuration that provider needs (endpoint, deployment, region, model, credential ID, ...).
Cross-cutting settings that apply the same way to every provider - temperature, timeout,
max log context characters - live once on ChangeInvestigatorGlobalConfiguration
instead of being duplicated onto each subclass.
Never holds a resolved secret: subclasses store only a Jenkins credential ID (a
non-secret reference) and resolve it to plaintext at call time in createProvider(com.fasterxml.jackson.databind.ObjectMapper, int),
the same pattern the plugin already used before this provider abstraction existed.
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract AiProvidercreateProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int timeoutSeconds) Builds a provider bound to this configuration's resolved settings, ready to make one (or more)AiProvider.chatCompletion(io.jenkins.plugins.changeinvestigator.ai.AiAnalysisRequest)calls.abstract StringgetModel()The model identifier this configuration will request, for display purposes.testConnection(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int timeoutSeconds) Sends a minimal, low-cost request to verify this configuration works.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.Describable
getDescriptor
-
Constructor Details
-
AiProviderConfig
public AiProviderConfig()
-
-
Method Details
-
getModel
The model identifier this configuration will request, for display purposes. -
createProvider
public abstract AiProvider createProvider(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int timeoutSeconds) Builds a provider bound to this configuration's resolved settings, ready to make one (or more)AiProvider.chatCompletion(io.jenkins.plugins.changeinvestigator.ai.AiAnalysisRequest)calls. Resolving the credential happens inside this method, not before it, so the plaintext secret's lifetime is limited to the call that actually needs it.- Parameters:
objectMapper- shared Jackson mapper for building/parsing request and response JSONtimeoutSeconds- administrator-configured connect/request timeout (a global, not per-provider, setting - seeChangeInvestigatorGlobalConfiguration)
-
testConnection
public FormValidation testConnection(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int timeoutSeconds) Sends a minimal, low-cost request to verify this configuration works. Deliberately does not send any real build evidence - only a fixed instruction-only exchange - so testing a connection never depends on (or leaks) actual investigation data.
-