License: MIT

This is a text bot for iMessage that was inspired by South Park's 'Deep Learning' episode. The program was made to continuously run so that it is constantly checking whether or not it needs to respond to a text message. If the specified number texts you, it will automatically feed the text message into OpenAI's ChatGPT API and come up with a response to the text. This text will then be sent to the phone number you specified.

There are options to configure this program such as removing the 'Approval' required before sending automatically sending responses. I added many comments throughout the code in case you are curious about what is going on. Also, in the comments I make note of some changes in functionality you can make.

This project is still heavily under development, so expect there to be updates and changes in the coming days.

If you like my work please consider donating:

Buy Me A Coffee

Getting Started

These are some basic instructions to help you get started.

Prerequisites

What you need to install:

Follow this link to enable full disk access for Terminal. This allows the program to access your chat.db in order to read and respond to text messages.

Installing

A step by step series of examples that tell you how to get a development env running

Install OpenAI API (After Obtaining an API key from the website)

pip install openai

Install imessage-reader

pip install imessage-reader

Usage

Before using the program, open the file 'config.py' and paste your OpenAI API key on the designated location (This never changes). Then paste the phone number you want to text with at the designated location (This you may change often depending on who you want to text). You also need to specify the path to the send_iMessage.scpt file that was downloaded (This is most likely located in the same directory as the other files you downloaded). For Example: script_path = "/Users/name/Desktop/text-bot-GPT/send_iMessage.scpt"

To run the program simply open your Terminal and go to the directory in which the files are located.

Then run:

python3 text-bot-GPT.py

This starts the program using your provided configuration. The program will say 'waiting' if you were the last to text in a conversation. Otherwise it will print out a person's text, print out ChatGPT's response, and await your approval before sending.

Built With

Contributing

Please read CONTRIBUTING.md for details on the code of conduct, and the process for submitting pull requests to us. Follow the general guidelines outlined in the link.

Author

Franco (FrancoLopezDev)

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments