Clipboard Transformer Function (JavaScript) - Crash BTT after using my shortcut < 10 times

When I use Clipboard Transformer Function (JavaScript) the BTT app crashes once I have used my shortcut 10 times (probably a memory problem.

However I use the javascript recommendations as explained, with a return

Here I use a shortcut with "fetch" to use the OPEN AI API.
My first "showHUD" starts, but the app stucked after that.

I see that I have the same problem if I use things like "setinterval" or whatever.

How can I easily debug my code, other than seeing BTT be stucked?

Thank you :pray:

Can you post the full code of the script here? Then I can try to see whether it's somehow leaking memory

By the way, 4.485 alpha has a native "Transform Clipboard Contents With ChatGPT" action if that is all you need!

Ok never see it before, just seeing the Transform & Replace Selection with ChatGPT which never working for me.

But I guess I can have move flexibility using request directly on OpenApi, like use my own key :blush:

The action also allows you to use your own key (it requires the latest alpha version)

I'll have a look at your script soon!

Thanks Andreas :blush:

All features with ChatGPT inside BTT directly failed on my side.

Could you go to help => export diagnostic debug information and send the result to andreas@folivora.ai? The logs should contain any error returned from OpenAI.