James is a CLI (command-line interface) for interacting with OpenAI's Chat GPT using voice and text.
Main functionality:
- ask questions via Voice and James reads it aloud
- automatically copy Code from answers to the clipboard
- save answers to files
- append text and code files to your prompt
- fetch news articles from various sources (Hacker News, CNN, etc.) and generate summarized versions of them
With more to come...
- Python 3.8+
- A working installation of
pip
- A valid
API key
for OpenAI - (optional) A valid
API key
andAPI secret
for UberDuck
-
Clone the repository
git clone [email protected]:guarilha/james.git
andcd james
. -
Install the required dependencies using
pip
:pip install -r requirements.txt
-
Install the local package using
pip
:pip install -e .
james ask
james ask -q "What is the meaning of life?"
james ask -q "How do you stay inspired?" -c "Yoda from Star Wars"
james ask -q "How do you stay inspired?" -c "Harry Potter"
james ask -q "What are good python libraries to build CLI programs?" -p tts
james ask -q "Why would anyone build a CLI in 2023?" -p uberduck
james ask -q "Review this code" -f sample_code.py
james ask -q "What is the best way to learn Python?" -s answer.txt
james news
james news -c hackernews
james news -c "business and finance" -l
james news -p 5
james news -c "politics" --is-list
james --help
Interact with Chat GPT using voice and text.
james ask [OPTIONS]
Options:
--question, -q QUESTION
: Bypass capturing the mic audio and speech to text.--character, -c CHARACTER
: A profession, a name of a famous person, or from fiction (movies, series, etc.).--play, -p PLAY
: Read aloud the answer at the end. Options are: tts, uberduck.--file, -f FILE
: Upload a text or code file at the end of your prompt.--save, -s SAVE
: Save the answer to a file.--no-clipboard, -b
: Avoid copying code content to the clipboard.
Fetch news articles from sources and generate summaries.
james news [OPTIONS]
Options:
--category, -c CATEGORY
: Search from Hacker News or selected news sites (CNN, etc.).--number, -n NUMBER
: Number of news articles you want to fetch.--position, -p POSITION
: Fetch news at a specific position.--is-list, -l
: Avoid news summaries and only print a list.
Start the API
flask run
And on a different terminal
curl -X POST -H "Content-type: application/json" -d "{\"question\" : \"I have a flask api that needs to validate the schema of a POST body, how do I do that?\"}" http://127.0.0.1:5000/ask