chatgpt | openai | api | curl | json

Use jq and especially jo for string and parameter creation.

Handle special-character-problems ( ‘ % $ and million others ) by url encoding your strings directly at the source. chatgpt api natively speaks urlencode.

I’ve tried base64, but the chatbot mentions in his answer that he/she was fed with base64 encoded stuff.

To encode use urlencode (who unfort can not read from stdin, you will have to do some xargs gymnastics) or, better, use perl: https://bytesandbones.wordpress.com/2023/03/23/encode-url-with-perl/

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.