public FieldValue generate(Prompt prompt, Context context) {
            var parts = Arrays.stream(prompt.asString().split(" ")).toList();

            var dataType = new StructDataType("myStructType");
            dataType.addField(new Field("myField1", DataType.STRING));
            dataType.addField(new Field("myField2", DataType.STRING));
            
            var value = dataType.createFieldValue();
            value.setFieldValue("myField1", new StringFieldValue(parts.get(0)));
            value.setFieldValue("myField2", new StringFieldValue(parts.get(1)));
            
            return value;
        }
Tests a common use case where an array is generated from one text input.
indexinglanguage/src/test/java/com/yahoo/vespa/indexinglanguage/GenerateExpressionTestCase.java