ykdojo / kaguya

A ChatGPT plugin that allows you to load and edit your local files in a controlled way, as well as run any Python, JavaScript, and bash script.
http://kaguya.ai/
MIT License
1.2k stars 192 forks source link

Added replaceAll parameter to update endpoint #21

Closed dave1010 closed 1 year ago

dave1010 commented 1 year ago

ChatGPT did most of the work here, editing the plugin itself.

It updated the JS fine with the existing update command.

It then tried to use the replaceAll param and got back UnrecognizedKwargsError. That seems to be an OpenAI thing. ChatGPT did some testing and it happened whenever it called an API endpoint with a param that's not in the openapi.yaml. Presumably that's a safety thing.

We went round in circles a bit here, thinking it was some kind of next.js cache! Then we realised we could make changes to the messages immediately.

The solution is updating the openapi.yaml file, then clicking "Refresh plugin" in the ChatGPT Plugin devtools sidebar (for anyone else reading this, you get to that from the ChatGPT settings on the bottom left.)

Once I'd done this, replaceAll worked fine and ChatGPT did some tests to check the functionality works fine.

ykdojo commented 1 year ago

Thank you for this PR! I added a small comment.

ykdojo commented 1 year ago

@dave1010 why did you close? Sorry I didn't see your earlier commit

dave1010 commented 1 year ago

Oops, sorry. I was cleaning up branches and projects and accidentally removed this one. I've just submitted the same PR again, as I don't think I can reopen this one.

https://github.com/ykdojo/kaguya/pull/28

ykdojo commented 1 year ago

No worries and thank you!