- Issue created by @utkarsh_33
- Merge request !1452#3541074: Add Validation for AI generated component after editing task. → (Merged) created by utkarsh_33
- 🇮🇳India utkarsh_33
I made the following changes in PropsSchema.json :-
{ "name": "Image with example value", "type": "object", "$ref": "json-schema-definitions://experience_builder.module/image", "example": { "width": "1200", "height": "900", "alt": "Example image placeholder" }, "id": "4ea2a14d-7828-467c-a505-063f006f1ebf", "derivedType": "image" },
use this image prop instead of the existing image prop to feed the wrong example to the AI about the prop structure so that it produces wrong props.
Now on any already existing component use a prompt which says
Add a image prop to the component
.
Adding a debugger on line$violations = JavaScriptComponent::createFromClientSide($output)->getTypedData()->validate();
in
EditComponentJs
then you can see validation errors. After proceeding further with the validation errors you can see the correct props structure being generated by AI and no errors occur after that and a valid structure is generated.
Marking this NR for an initial round of review.
- 🇮🇳India narendraR Jaipur, India
Tested it manually as suggested in #3 📌 Add Validation for AI generated component after editing task. Active and it is working as expected. Moving it to NW for one minor change and one explaination.
- 🇮🇳India narendraR Jaipur, India
Tested it couple of times and it is creating new component once and unable to determine the selected component. See attached SS.
- 🇮🇳India utkarsh_33
Modified the prompt and tested it manually. It works as expected. Marking it NR again.
- 🇮🇳India narendraR Jaipur, India
Tested manually and it is working as expected. Validation errors are logged and proper structure is generated. Moving it to RTBC.
- First commit to issue fork.
-
balintbrews →
committed 572ad4bd on 1.x authored by
utkarsh_33 →
Issue #3541074 by utkarsh_33, narendrar: Add Validation for AI generated...
-
balintbrews →
committed 572ad4bd on 1.x authored by
utkarsh_33 →
-
balintbrews →
committed a12695b5 on 0.x authored by
utkarsh_33 →
Issue #3541074 by utkarsh_33, narendrar: Add Validation for AI generated...
-
balintbrews →
committed a12695b5 on 0.x authored by
utkarsh_33 →
Automatically closed - issue fixed for 2 weeks with no activity.