Class BaseAIService

java.lang.Object
io.jenkins.plugins.explain_error.BaseAIService
Direct Known Subclasses:
GeminiService, OllamaService, OpenAIService

public abstract class BaseAIService extends Object
Base class for AI service implementations using LangChain4j. Provides common functionality for different AI providers.
  • Field Details

  • Constructor Details

  • Method Details

    • explainError

      public String explainError(String errorLogs) throws IOException
      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

      protected String determineBaseUrl(String providerName)
      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()