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) <noreply@anthropic.com>
This commit is contained in:
parent
8f8fba8263
commit
ffff250c79
|
|
@ -42,10 +42,12 @@ public class LLMBlockConfiguration extends BlockConfiguration<LLMBlockType> {
|
|||
|
||||
@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<LLMBlockType> {
|
|||
@Valid
|
||||
@Size(max = SkillsCatalogService.MAX_SKILLS_PER_BLOCK)
|
||||
@UiUniqueItemsBy("skillId")
|
||||
@UiOrder(50)
|
||||
@JsonProperty(required = false)
|
||||
List<SkillBinding> skills = List.of();
|
||||
|
||||
|
|
@ -65,6 +68,7 @@ public class LLMBlockConfiguration extends BlockConfiguration<LLMBlockType> {
|
|||
@Valid
|
||||
@Size(max = MCPToolServerBinding.MAX_PER_BLOCK)
|
||||
@UiUniqueItemsBy("serverName")
|
||||
@UiOrder(60)
|
||||
@JsonProperty(required = false)
|
||||
List<MCPToolServerBinding> mcpServers = List.of();
|
||||
|
||||
|
|
@ -99,7 +103,7 @@ public class LLMBlockConfiguration extends BlockConfiguration<LLMBlockType> {
|
|||
@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)
|
||||
|
|
|
|||
|
|
@ -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<String> 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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue