From ffff250c79c08b9b17f53ef7de86de59940e99fd Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Fri, 25 Sep 2026 19:10:37 +0200 Subject: [PATCH] Order an LLM node's fields the way it is set up Only the three most recent fields had an order, so they came first and the model and prompt last. Every field now has one: the model, the prompt and the files sent with it, then what the node may use - skills, MCP servers and the tools it must use successfully - and last the structured outputs it hands back. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../blocks/configurations/LLMBlockConfiguration.java | 6 +++++- .../blocks/configurations/LLMBlockSchemaTest.java | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockConfiguration.java b/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockConfiguration.java index 050061f..4dc1888 100644 --- a/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockConfiguration.java +++ b/src/main/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockConfiguration.java @@ -42,10 +42,12 @@ public class LLMBlockConfiguration extends BlockConfiguration { @NotNull @Valid + @UiOrder(20) @JsonProperty(required = true) LLMDescriptor llmDescriptor; @Structural + @UiOrder(30) @LongText(placeholder = "Write the prompt to execute", tip = "Use ${{}} to indicate variables, for example: What is the capital of ${{country}}? Append [] to a name to mark it as an array input, e.g. ${{scores[]}}.", acceptVariableAsPlaceholder = true) @JsonProperty(required = false) String prompt; @@ -54,6 +56,7 @@ public class LLMBlockConfiguration extends BlockConfiguration { @Valid @Size(max = SkillsCatalogService.MAX_SKILLS_PER_BLOCK) @UiUniqueItemsBy("skillId") + @UiOrder(50) @JsonProperty(required = false) List skills = List.of(); @@ -65,6 +68,7 @@ public class LLMBlockConfiguration extends BlockConfiguration { @Valid @Size(max = MCPToolServerBinding.MAX_PER_BLOCK) @UiUniqueItemsBy("serverName") + @UiOrder(60) @JsonProperty(required = false) List mcpServers = List.of(); @@ -99,7 +103,7 @@ public class LLMBlockConfiguration extends BlockConfiguration { @Valid @Size(max = 8) @UiUniqueItemsBy("name") - @UiOrder(75) + @UiOrder(40) @UiLabel("Files") @UiDescription("Images (PNG, JPEG, WebP) and PDF documents sent to the model with the prompt. A PDF is read natively where the provider can, and otherwise as its text - with its pages as images too when the model sees images.") @JsonProperty(required = false) diff --git a/src/test/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockSchemaTest.java b/src/test/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockSchemaTest.java index 9ad9a4c..eae12e7 100644 --- a/src/test/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockSchemaTest.java +++ b/src/test/java/it/cnr/isti/workflow/manager/blocks/configurations/LLMBlockSchemaTest.java @@ -30,4 +30,16 @@ class LLMBlockSchemaTest { assertEquals("mcpServers", visibleWhen.get("field").asText()); assertEquals(true, visibleWhen.get("present").asBoolean()); } + + @Test + void theFieldsReadInTheOrderANodeIsSetUp() { + // The model; what it is asked and given; what it may use; what it hands back. + JsonNode schema = schemaProducer.generateSchemaNode(LLMBlockConfiguration.class); + + java.util.List order = new java.util.ArrayList<>(); + schema.get("x-ui-property-order").forEach(name -> order.add(name.asText())); + + assertEquals(java.util.List.of("name", "llmDescriptor", "prompt", "uploadInputs", "skills", "mcpServers", + "requiredSuccessfulMcpTools", "outputs"), order.stream().filter(name -> !name.equals("type")).toList()); + } }