Class LlmConfigFormComponent
java.lang.Object
ai.mindconnect.adminui.ui.component.LlmConfigFormComponent
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionLlmConfigFormComponent(ai.mindconnect.llm.domain.LlmConfig config, List<ai.mindconnect.llm.domain.LlmConfig> allConfigs) -
Method Summary
Modifier and TypeMethodDescriptionstatic ai.mindconnect.ui.model.UiFieldGroupaliasGroup(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.UiFieldapiKeyField(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 itsenc:form via the server.static ai.mindconnect.ui.model.UiFieldGroupbaseGroup(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.UiFieldGroupproviderParamsGroup(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'sAdditionalParamSpeccatalog, filtered by config type, and swapped in place when provider or type changes.ai.mindconnect.ui.model.UiFormrender()static ai.mindconnect.ui.model.UiFieldGrouptypeGroup(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.UiFieldGroupwithHiddenIf(boolean hide, ai.mindconnect.ui.model.UiFieldGroup group) Marks the group hidden in alias mode — fields stay in the DOM.
-
Constructor Details
-
LlmConfigFormComponent
public LlmConfigFormComponent(ai.mindconnect.llm.domain.LlmConfig config, List<ai.mindconnect.llm.domain.LlmConfig> allConfigs) - Parameters:
config- the config being edited, ornullfor the "new config" formallConfigs- all stored configs — used to populate the "Delegates To" dropdown
-
-
Method Details
-
id
- Specified by:
idin interfaceUiComponent
-
apiKeyField
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 itsenc:form via the server. Also rebuilt by the/encrypt-keypatch 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'sAdditionalParamSpeccatalog, 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 ishidden()— 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:
renderin interfaceUiComponent
-