Class LlmConfigFormComponent

java.lang.Object
ai.mindconnect.adminui.ui.component.LlmConfigFormComponent
All Implemented Interfaces:
UiComponent

public final class LlmConfigFormComponent extends Object implements UiComponent
Edit form for an LLM configuration. Same component for both "new" (null config) and "edit" (existing config) modes — the differences are confined to factory-derived defaults, form id, and the submit target (POST vs PUT).
  • Constructor Summary

    Constructors
    Constructor
    Description
    LlmConfigFormComponent(ai.mindconnect.llm.domain.LlmConfig config, List<ai.mindconnect.llm.domain.LlmConfig> allConfigs)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static ai.mindconnect.ui.model.UiFieldGroup
    aliasGroup(boolean isAlias, String delegatesTo, UUID selfId, List<ai.mindconnect.llm.domain.LlmConfig> allConfigs)
    Alias mode shows exactly one thing: the delegation target.
    static ai.mindconnect.ui.model.UiField
    apiKeyField(String value, String formId)
    The API-key field: a PASSWORD input showing the key as stored (enc:… stays encrypted; the eye toggle reveals whatever is in the field), with a trailing Encrypt helper that turns a freshly typed plain key into its enc: form via the server.
    static ai.mindconnect.ui.model.UiFieldGroup
    baseGroup(boolean isAlias, String type, String provider, String model, String baseUrl, String apiKey, String formId, UUID configId)
    The provider-config fields (type, provider, model, base URL, API key) — hidden entirely in alias mode.
    id()
     
    static ai.mindconnect.ui.model.UiFieldGroup
    providerParamsGroup(ai.mindconnect.llm.domain.LlmProvider provider, ai.mindconnect.llm.domain.LlmConfigType type, ai.mindconnect.llm.domain.LlmConfig config)
    The provider-specific additional parameters — rendered straight from the provider's AdditionalParamSpec catalog, filtered by config type, and swapped in place when provider or type changes.
    ai.mindconnect.ui.model.UiForm
     
    static ai.mindconnect.ui.model.UiFieldGroup
    typeGroup(boolean isEmbedding, ai.mindconnect.llm.domain.LlmConfig config)
    The type-specific settings, swapped in place when the "Embedding Model" checkbox toggles.
    static ai.mindconnect.ui.model.UiFieldGroup
    withHiddenIf(boolean hide, ai.mindconnect.ui.model.UiFieldGroup group)
    Marks the group hidden in alias mode — fields stay in the DOM.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LlmConfigFormComponent

      public LlmConfigFormComponent(ai.mindconnect.llm.domain.LlmConfig config, List<ai.mindconnect.llm.domain.LlmConfig> allConfigs)
      Parameters:
      config - the config being edited, or null for the "new config" form
      allConfigs - all stored configs — used to populate the "Delegates To" dropdown
  • Method Details

    • id

      public String id()
      Specified by:
      id in interface UiComponent
    • apiKeyField

      public static ai.mindconnect.ui.model.UiField apiKeyField(String value, String formId)
      The API-key field: a PASSWORD input showing the key as stored (enc:… stays encrypted; the eye toggle reveals whatever is in the field), with a trailing Encrypt helper that turns a freshly typed plain key into its enc: form via the server. Also rebuilt by the /encrypt-key patch endpoint, hence static.
    • typeGroup

      public static ai.mindconnect.ui.model.UiFieldGroup typeGroup(boolean isEmbedding, ai.mindconnect.llm.domain.LlmConfig config)
      The type-specific settings, swapped in place when the "Embedding Model" checkbox toggles. Chat configs carry the sampling/retry knobs; an embedding model only needs its input window.
    • providerParamsGroup

      public static ai.mindconnect.ui.model.UiFieldGroup providerParamsGroup(ai.mindconnect.llm.domain.LlmProvider provider, ai.mindconnect.llm.domain.LlmConfigType type, ai.mindconnect.llm.domain.LlmConfig config)
      The provider-specific additional parameters — rendered straight from the provider's AdditionalParamSpec catalog, filtered by config type, and swapped in place when provider or type changes. An empty group (provider without extra params) keeps the id anchored for the patch but renders nothing visible.
    • aliasGroup

      public static ai.mindconnect.ui.model.UiFieldGroup aliasGroup(boolean isAlias, String delegatesTo, UUID selfId, List<ai.mindconnect.llm.domain.LlmConfig> allConfigs)
      Alias mode shows exactly one thing: the delegation target. In provider mode the group is hidden() — still in the DOM (so the swap patch has its anchor and the value survives), just not visible.
    • baseGroup

      public static ai.mindconnect.ui.model.UiFieldGroup baseGroup(boolean isAlias, String type, String provider, String model, String baseUrl, String apiKey, String formId, UUID configId)
      The provider-config fields (type, provider, model, base URL, API key) — hidden entirely in alias mode. Values come from the submitted form when the swap is triggered by a toggle (so typed input survives), from the stored config on first render.
    • withHiddenIf

      public static ai.mindconnect.ui.model.UiFieldGroup withHiddenIf(boolean hide, ai.mindconnect.ui.model.UiFieldGroup group)
      Marks the group hidden in alias mode — fields stay in the DOM.
    • render

      public ai.mindconnect.ui.model.UiForm render()
      Specified by:
      render in interface UiComponent