I've got an existing app where users can enter regex expressions that they'd like to match against text to create a "trigger". Players can also add code to these triggers that will get executed when the trigger does match certain text.
As you can imagine, creating regexes is not a trivial thing and requires technical know-how. I'd like to lower the bar for this by engaging an AI (in this case, Petals). The basic idea is this: the user can give the AI a few example lines they'd like the trigger to match, and the AI will come up with a regex that does so.
How can I best integrate this into the existing editor, which looks like this?
The editor can also have a more expanded version with more advanced features available: