Package io.jenkins.plugins.explain_error
Class BaseAIService
java.lang.Object
io.jenkins.plugins.explain_error.BaseAIService
- Direct Known Subclasses:
GeminiService,OllamaService,OpenAIService
Base class for AI service implementations using LangChain4j.
Provides common functionality for different AI providers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final GlobalConfigurationImplprotected static final Logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract io.jenkins.plugins.explain_error.BaseAIService.Assistantprotected StringdetermineBaseUrl(String providerName) Determines the base URL to use for the AI service.explainError(String errorLogs) Explain error logs using the configured AI provider.
-
Field Details
-
LOGGER
-
config
-
-
Constructor Details
-
BaseAIService
-
-
Method Details
-
explainError
Explain error logs using the configured AI provider.- Parameters:
errorLogs- the error logs to explain- Returns:
- the AI explanation
- Throws:
IOException- if there's a communication error
-
determineBaseUrl
Determines the base URL to use for the AI service. Returns the custom URL if provided and not empty, otherwise returns null to let the service use its default endpoint.- Parameters:
providerName- the name of the provider (for logging purposes)- Returns:
- the base URL to use, or null to use the default
-
createAssistant
protected abstract io.jenkins.plugins.explain_error.BaseAIService.Assistant createAssistant()
-