Take dictation as input and let ChatGPT rewrite it (not working)

So ChatGPT is great and reproducing other people’s code it has surfaced from across the Internet from a while back, but it really doesn’t generally do well when it comes to writing code for things like Drafts or making use of things that have come along more recently.

The JavaScript it has provided is incompatible with Drafts. The fetch would instead use the http class in Drafts, and in any case, there is a (fairly new) class for interacting direct with OpenAI API - OpenAI.

The reason it isn’t outputting anything is because it is using the wrong classes and constructs (e.g., read about async and Drafts here).

You would be better off just using or adapting one of the many existing ChatGPT examples for Drafts. Do a search on this forum, in the Drafts directory, and look at the examples on the OpenAI page in the documentation.

1 Like