Open TiloGit opened 1 year ago
here my poor man rate limit loop, might help someone for now.
###simple loop with rate limit helper 3 per min
for file in *.txt
do
echo "$(date +"%F_%s") now Work on ___ ${file}"
filebase=$(basename "$file" .txt)
i=$(($i+1))
echo "write letter ${filebase}" | chatgpt > "chatGPT-output/${file}"
##sleep to avoid rate limit
if test $i -gt 2 ; then echo "Wait to avoid rate limit: $i" && sleep 65 && i=$null; else echo "We are good :: $i" ; fi
done
would be great if the tool could understand when a rate limit is hit and wait for the suggested seconds (seems to be always 20s) and try again. maybe allow max retires in the cmd line.
Cheers