Skip to content

Cortex-AGI/TeamsGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TeamsGPT

TeamsGPT lets you connect your Microsoft account to ChatGPT, allowing it to reply to your Teams DMs!

This is highly configurable and lets you enter userIDs to reply to, whilst it ignores all the others

How does it work?

Using the MS Graph API, it retrieves user messages, then filters the unread ones by user ID (specified in config)
If it matches a "target", then it sends it to the ChatGPT API, with past conversation context, and then generates+sends a response

Requirements

Relies on Python 3.9+

Install the required dependencies via:

pip3 install -r ./requirements.txt

Setup

NOTE: Currently this only works with enterprise or educational Microsoft Accounts as personal ones do not offer the APIs used

  1. Create an OpenAI account and get an API Key here
  2. Register a new app here
  3. Add a redirect URI with platform set to Web and URI set to http://localhost:5000/loggedIn
  4. Under the Certificates & Secrets section, create a new client secret
  5. Create a secrets.json file with the following contents:
{
    "AI.api_key": "[API Key from OpenAI]",
    "MS.client_id": "[MS Application ID]",
    "MS.client_secret": "[MS Client Secret]",
    "MS.tenant": "[MS Tenant ID]"
}
  1. Run sign-in.py and click on the link shown in the terminal and follow the instructions, once you see You are now signed in! (You can stop running the program now) quit the program
  2. Run listChats.py

Create a config.json file with the following contents:

{
    "targetUserIDs": []
}
  1. Add the target UserIDs from the members lists supplied by listChats.py
  2. Run main.py
  3. Enjoy!

About

Connect ChatGPT to your Teams DMs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages