3 ms·
I have a basic python script running in one of my tabs on my CLI to talk to OpenAI. It's not even 50 lines. It's basically just a while loop for user input, whi
by aqme28 3y ago
I have a basic python script running in one of my tabs on my CLI to talk to OpenAI. It's not even 50 lines. It's basically just a while loop for user input, which it then sends to the the ChatGPT API and prints the response. Add a try/catch for rate limits and connection issues and that's it.
It's really nice to have an always-open ChatGPT equivalent in one of my terminal tabs that I can switch to at any time.
- sethgecko 3y agoI made a small wrapper too, you call it from the command line and it keeps the conversation context for 15 minutes in a temp file. https://github.com/mcdallas/gptask https://github.com/mcdallas/gptask
- aqme28 3y agoI just keep mine in memory for simplicity, but it’s nice that you can restart old ones.
- ahefner 3y agoSame here, pretty much. I didn't even write it. I asked GPT-4 for the code from the API playground, and it just worked.