Plugin kwargs maximum length

I’m writing a plugin that retrieves a page or two of text from an API, makes some revisions and submits that to another endpoint using a POST request. I notice that whenever the length of the revised version exceeds some amount, ChatGPT halts in the middle of forming the kwargs JSON, and after some time I see the following error:

ApiSyntaxError: Could not parse API call kwargs as JSON: exception=Unterminated string starting at: line 5 column 13 (char 291) url=http://localhost:5000/projects/{project_id}/drafts

I noticed that the generated kwargs are alway exactly 760 tokens long before being terminated. Is that a documented or undocumented limitation or a bug?

Update: now it tries composing the request but fails, deletes the request from the UI it and says:

I apologize for the inconvenience. There seems to be a technical issue with the plugin that is preventing the submission of the draft. I will report this to the technical team for resolution.

Which is worse in it’s own way, as it is not reporting anything to anyone and there is no sign of the problem left for the users or developers to report or identify the issue.

1 Like