GithubHelp home page GithubHelp logo

textsgpt's Introduction

textsGPT

Code style: black

TODO (summary of project)

Getting started

Prerequisites

  1. This project requires using macOS. It reads messages from the built-in messages database on Mac. I welcome future support for other operating systems and/or just passing in messages as a CSV file.
  2. This project was written using Python 3.12.3. It may work with other Python versions. Download python: https://www.python.org/downloads/
  3. You need an OpenAI API key to use with this project.

Installation

  1. Clone the repository:
git clone https://github.com/tommypraeger/textsGPT.git
  1. Navigate to the repository directory:
cd textsGPT
  1. Create a virtual environment:
python3 -m venv venv
  1. Activate the virtual environment:
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set environment variables (you can use a .env file to define them if you would like):

    1. OPENAI_API_KEY=<your OpenAI API key>. https://help.openai.com/en/articles/4936850-where-do-i-find-my-openai-api-key
    2. (optional) TOKENIZERS_PARALLELISM=false . Could help prevent the messages described here from being printed.
  2. Give the application you will use to run this script Full Disk Access (I know this seems sketchy but it needs to be able to access the messages database stored on your Mac, which is not available to applications by default):

    1. Open System Preferences
    2. Go to Security and Privacy
    3. Go to Privacy
    4. Go to Full Disk Access
    5. Give whatever application you're running this from Full Disk Access

    Note: These instructions might be different on newer versions of macOS. These instructions work for macOS Monterrey (v12) (I need a new Mac to use a newer version)

Usage

First, edit the CHATS dictionary in textsgpt/mac/my_chats.py to include information about the chat(s) you want to use.

Run the script (replace <name of chat> with the dictionary key you used for the chat in CHATS):

python3 -m textsgpt "<name of chat>"

The first execution of the script can take several minutes for large chats as it builds an index for the entire content of the chat. Subsequent executions for the same chat should be faster as only new messages since the last script execution need to be indexed.

Once the indexing finishes, you can prompt the chatbot for information about your chat. Some example prompts:

  • Suggest a new name for the group chat
  • Please suggest date ideas that <name> would like in New York City. Be specific.
  • What does <name> think about <topic>?

Configurations

TODO (note about changing default values)

Contributing

Formatting

This project uses black for formatting. Following the instructions for installation. Once installed, format by running the following from the root of this project:

black .

Typing

This project uses typing. If you are using VS Code and have a Python language server configured, I recommend setting "python.analysis.typeCheckingMode": "strict" in your settings.json to enforce type checking. Learn more here.

Testing

Unit tests

This project uses pytest. To run unit tests, run the following from the root of this project:

pytest

To generate a test coverage report, run:

pytest --cov-report=term-missing --cov=textsgpt

Manual testing

To change the contents of my_chats.py without accidentally committing your chat info, you can run:

git update-index --assume-unchanged textsgpt/mac/my_chats.py

If you want git to track my_chats.py again, run:

git update-index --no-assume-unchanged textsgpt/mac/my_chats.py

Ideas for improvement

TODO

Acknowledgements

textsgpt's People

Contributors

tommypraeger avatar

Watchers

Kostas Georgiou avatar  avatar

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.