LLM chat via CLI
MIT License -- See LICENSE
file for details.
Go get an OpenAI API key and set it as an environment variable in .env file:
CASTLLM_OPENAI_KEY=<api key>
python3 castllm.py
Press cntr+c to exit chat.
Use ChatGPT 4 (default is ChatGPT 3-turbo)
python3 castllm.py --use gpt4
Sessions are saved to JSON files in sessions/
directory. The filename is the topic of the chat and the timestamp
of the start of the chat. Generated by ChatGPT 3-turbo model.
Reload a saved session to continue a chat:
python cast_llm.py --load-session sessions/Woodchuck_and_tongue_twister_explanation-20231006-142440.json
Loading session example output:
python cast_llm.py --load-session sessions/Woodchuck_and_tongue_twister_explanation-20231006-142440.json
╭───────────────────────────────────────────────────────╮
│ Chat Topic: Woodchuck and tongue twister explanation. │
╰───────────────────────────────────────────────────────╯
system: You are now chatting with ChatGPT.
user: How much can a wood-chuck chuck?
assistant: A woodchuck, also known as a groundhog, is a burrowing rodent known for digging
holes. The phrase "how much wood could a woodchuck chuck" is actually a popular tongue
twister rather than a serious question. It's meant to be a playful linguistic exercise, and
there is no definitive answer. However, if you were inquiring about the amount of dirt a
woodchuck can excavate while burrowing, they're capable of moving several pounds of soil.