Skip to content

Latest commit

 

History

History
56 lines (35 loc) · 3.98 KB

README.md

File metadata and controls

56 lines (35 loc) · 3.98 KB

How to use this ChatGPT Teams Bot app

This is a ChatGPT Teams Bot app to let you chat with ChatGPT in Microsoft Teams.

You could also try the ChatGPT WeChat Bot.

ChatGPT

Prerequisites

Get API key

Get an OpenAI API key from https://beta.openai.com/account/api-keys.

Debug

  • Create a .env.teamsfx.local file under bot 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 the Run and Debug green arrow button.
  • From TeamsFx CLI: Start debugging the project by executing the command teamsfx preview --local in your project directory.

Deploy to Azure

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
  • Open Teams Toolkit, and sign into Azure by clicking the Sign in to Azure under the ACCOUNTS section from sidebar.
  • After you signed in, select a subscription under your account.
  • Open the Teams Toolkit and click Provision in the cloud from DEPLOYMENT section or open the command palette and select: Teams: Provision in the cloud.
  • Open the Teams Toolkit and click Deploy to the cloud or open the command palette and select: Teams: Deploy to the cloud.
  • Run command teamsfx account login azure.
  • Run command teamsfx account set --subscription <your-subscription-id>.
  • Run command teamsfx provision.
  • Run command: teamsfx deploy.

Note: Provisioning and deployment may incur charges to your Azure Subscription.

Preview

Once the provisioning and deployment steps are finished, you can preview your app:

  • From Visual Studio Code

    1. Open the Run and Debug Activity Panel.
    2. Select Launch Remote (Edge) or Launch Remote (Chrome) from the launch configuration drop-down.
    3. Press the Play (green arrow) button to launch your app - now running remotely from Azure.
  • From TeamsFx CLI: execute teamsfx preview --remote in your project directory to launch your application.

Further reading