Git Product home page Git Product logo

james's Introduction

James: Voice and Text Interaction with Chat GPT

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...

Prerequisites

  • Python 3.8+
  • A working installation of pip
  • A valid API key for OpenAI
  • (optional) A valid API key and API secret for UberDuck

Installation

  1. Clone the repository git clone [email protected]:guarilha/james.git and cd james.

  2. Install the required dependencies using pip:

    pip install -r requirements.txt
    
  3. Install the local package using pip:

    pip install -e .
    

Examples

Speak a question and get the response from Chat GPT.

james ask

Ask a question directly.

james ask -q "What is the meaning of life?"

Ask a question as a specific character

james ask -q "How do you stay inspired?" -c "Yoda from Star Wars"
james ask -q "How do you stay inspired?" -c "Harry Potter"

Read aloud the answer.

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

Upload a file with your question.

james ask -q "Review this code" -f sample_code.py

Save the answer to a file.

james ask -q "What is the best way to learn Python?" -s answer.txt

Get top news from Hacker News.

james news
james news -c hackernews

Get a list of tech news articles for a category.

james news -c "business and finance" -l

Get a summary of the article at a specific position from Hacker News.

james news -p 5

Get a list of political news articles and avoid summaries.

james news -c "politics" --is-list

Docs

General Help

james --help

ask Command

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.

news Command

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.

API

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

james's People

Contributors

guarilha avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

jcaiqueoliveira

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.