News for hackers. Stuff that matters.
Re:CLI tools for working with ChatGPT and other LLMs by aqme28 on Thursday May 18, 2023 @06:44PM (#35995265)
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.

Re:CLI tools for working with ChatGPT and other LLMs by sethgecko on Thursday May 18, 2023 @07:07PM (#35995547)
I 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

Re:CLI tools for working with ChatGPT and other LLMs by aqme28 on Thursday May 18, 2023 @07:11PM (#35995596)
I just keep mine in memory for simplicity, but it’s nice that you can restart old ones.
Re:CLI tools for working with ChatGPT and other LLMs by ahefner on Thursday May 18, 2023 @10:46PM (#35997151)
Same here, pretty much. I didn't even write it. I asked GPT-4 for the code from the API playground, and it just worked.