A minimal GPT chat client in the terminal. A toy experiment with OpenAI's GPT API.
All code have only tested on macOS, not guaranteed to work on other platforms.
export OPENAI_API_KEY=<your key>
python -m termchat-venv
source termchat-venv/bin/activate
pip install -r requirements.txt
# Optional, for PDF OCR if you want multi-language support
# Read more here: https://github.com/ocrmypdf/OCRmyPDF#languages
brew install tesseract-lang
Usage: python script.py [OPTIONS]
Options:
-c, --load-character FILE Specify a character file location.
--stream Enable streaming mode.
-e, --load-engine TYPE Specify an engine type, default is `gpt-3.5-turbo`.
--tts Enable text-to-speech.
-q, --question Ask a question to the chatbot and get an answer directly.
--help Show this message and exit.
python chat.py
🎬 Example usage
chat1.mp4
python chat.py -c <character>
🎬 Example usage
chat2.mp4
python chat.py -q
🎬 Example usage
Screen.Recording.2023-07-10.at.14.11.55.mov
# Normal usage
python pdf.py -f <file>
# Add --ocr if your PDF doesn't have text layer, default OCR language is English
python pdf.py -f <file> --ocr
# Add --ocr-lang to specify OCR language
# For <lang>, use 3-digit ISO 639-2 Code, see more here: https://github.com/tesseract-ocr/tessdata
python pdf.py -f <file> --ocr --ocr-lang <lang>