Class ChatModelAIProvider

All Implemented Interfaces:
ExtensionPoint, Describable<BaseAIProvider>
Direct Known Subclasses:
AnthropicProvider, BedrockProvider, DeepSeekProvider, GeminiProvider, MicrosoftFoundryProvider, OllamaProvider, OpenAICompatibleProvider, OpenAIProvider, QwenProvider

public abstract class ChatModelAIProvider extends BaseAIProvider
Base class for providers whose backend is a langchain4j ChatModel.

Subclasses implement only createChatModel(hudson.model.Item, org.springframework.security.core.Authentication, java.lang.Double): the assistant plumbing lives here, and because the model factory receives the full request context (credentials scope and temperature) in one signature, a provider cannot accidentally drop a parameter the way the old per-provider overload copies could. Providers that talk to their API directly (without a ChatModel) extend BaseAIProvider instead.

  • Constructor Details

    • ChatModelAIProvider

      protected ChatModelAIProvider(String url, String model)
  • Method Details

    • createChatModel

      protected abstract dev.langchain4j.model.chat.ChatModel createChatModel(@CheckForNull Item item, @CheckForNull org.springframework.security.core.Authentication authentication, @CheckForNull Double temperature)
      Creates the chat model for one request.
      Parameters:
      item - the item defining the credentials scope, or null
      authentication - the authentication for credentials lookup, or null
      temperature - the temperature to use, or null for the provider default
      Returns:
      the configured chat model
    • createAssistant

      public BaseAIProvider.Assistant createAssistant(@CheckForNull Item item, @CheckForNull org.springframework.security.core.Authentication authentication, @CheckForNull Double temperature)
      Description copied from class: BaseAIProvider
      The single assistant factory providers implement. It receives the full request context — credentials scope and temperature — so that a provider cannot accidentally drop a parameter by overriding the wrong overload (the narrower createAssistant variants are final and delegate here). Providers without item-scoped credentials simply ignore item/authentication.
      Specified by:
      createAssistant in class BaseAIProvider
      Parameters:
      item - the item defining the credentials scope, or null
      authentication - the authentication for credentials lookup, or null
      temperature - the temperature to use, or null for the provider default
      Returns:
      the assistant
    • createFixAssistant

      public FixAssistant createFixAssistant(@CheckForNull Item item, @CheckForNull org.springframework.security.core.Authentication authentication)
      Description copied from class: BaseAIProvider
      The single fix-assistant factory providers implement; the no-arg createFixAssistant() is final and delegates here.
      Specified by:
      createFixAssistant in class BaseAIProvider
      Parameters:
      item - the item defining the credentials scope, or null
      authentication - the authentication for credentials lookup, or null
      Returns:
      the fix assistant