As of 8/2023, ChatGPT has a bug / problem that when a plugin request contains a long string such as a multi line text fragment that often leads to ApiSyntaxError: Could not parse API call kwargs as JSON: exception=Expecting ',' delimiter...
during the plugin call because the generated JSON for the request is wrong. For instance:
{
"path": "ui.apps/src/test/content/jcr_root/apps/foo/bar/_cq_dialog/.content.xml",
"replacements": [
{
"search": "</items>\n </content>",
"replace": "<generationControl jcr:primaryType=\"nt:unstructured\" sling:resourceType=\"granite/ui/components/coral/foundation/container\" fieldDescription=\"Generation Control\">\n" +
" <items jcr:primaryType=\"nt:unstructured\">\n" +
" <generationControlButtons jcr:primaryType=\"nt:unstructured\" sling:resourceType=\"granite/ui/components/coral/foundation/container\"
...
Note that in the replace it uses a + to concatenate Strings in the text fragment, which would be perfectly fine for Javascript, but not JSON. Unfortunately that seriously harms my Developers Workbench plugin.
Now - if OpenAI would just support that kind of plugin request, that would nicely solve this bug. (Is there an official place where to report such ChatGPT bugs?)
In the meantime - has somebody a workaround for that problem? I partially “solved” a similar problem that the ChatGPT plugin mechanism gives a bad error message ApiSyntaxError: Could not parse API call kwargs as JSON: exception=Unterminated string ...
to ChatGPT whenever the plugin request is too long by explaining that to ChatGPT in the description_for_model in ai-plugin.json , but that isn’t a particularily nice approach. The only thing I can think of is to change the format of the plugin requests from a multi line string to an array of strings, one for each line of the text, but I’m not sure if that’ll degrade performance.
Thanks so much,
Hans-Peter