This is a ChatGPT Teams Bot app to let you chat with ChatGPT in Microsoft Teams.
You could also try the ChatGPT WeChat Bot.
- An OpenAI account
- NodeJS (Tested on Node.js 18.12.1)
- An M365 account. If you do not have M365 account, apply one from M365 developer program
- Latest stable version of Teams Toolkit Visual Studio Code Extension (Tested on version 4.1.3)
Get an OpenAI API key from https://beta.openai.com/account/api-keys.
- Create a
.env.teamsfx.local
file underbot
folder, and set the OpenAI API key in.env.teamsfx.local
file:OPENAI_API_KEY=xxxxxxxxxx
- From Visual Studio Code: Start debugging the project by hitting the
F5
key in Visual Studio Code. - Alternatively use the
Run and Debug Activity Panel
in Visual Studio Code and click theRun and Debug
green arrow button. - From TeamsFx CLI: Start debugging the project by executing the command
teamsfx preview --local
in your project directory.
First, set OPENAI_API_KEY
in envionment variables of your OS.
Then, deploy your project to Azure by following these steps:
From Visual Studio Code | From TeamsFx CLI |
---|---|
|
|
Note: Provisioning and deployment may incur charges to your Azure Subscription.
Once the provisioning and deployment steps are finished, you can preview your app:
-
From Visual Studio Code
- Open the
Run and Debug Activity Panel
. - Select
Launch Remote (Edge)
orLaunch Remote (Chrome)
from the launch configuration drop-down. - Press the Play (green arrow) button to launch your app - now running remotely from Azure.
- Open the
-
From TeamsFx CLI: execute
teamsfx preview --remote
in your project directory to launch your application.
- chatgpt-api Node SDK: it is a 3rd-party ChatGPT npm used in this Teams bot.