This app template is built on top of Teams AI library. It showcases a bot app that responds to user questions like ChatGPT. This enables your users to talk with the AI bot in Teams.
Prerequisites
To run the template in your local dev machine, you will need:
- Node.js, supported versions: 18, 20.
- Teams Toolkit Visual Studio Code Extension latest version or Teams Toolkit CLI.
- Prepare your own Azure OpenAI resource.
For local debugging using Teams Toolkit CLI, you need to do some extra steps described in Set up your Teams Toolkit CLI for local debugging.
- First, select the Teams Toolkit icon on the left in the VS Code toolbar.
- In file env/.env.testtool.user, fill in your Azure OpenAI key
SECRET_AZURE_OPENAI_API_KEY=<your-key>
, endpointAZURE_OPENAI_ENDPOINT=<your-endpoint>
, and deployment nameAZURE_OPENAI_DEPLOYMENT_NAME=<your-deployment>
. - Press F5 to start debugging which launches your app in Teams App Test Tool using a web browser. Select
Debug in Test Tool
. - You can send any message to get a response from the bot.
Congratulations! You are running an application that can now interact with users in Teams App Test Tool:
Folder | Contents |
---|---|
.vscode |
VSCode files for debugging |
appPackage |
Templates for the Teams application manifest |
env |
Environment files |
infra |
Templates for provisioning Azure resources |
src |
The source code for the application |
The following files can be customized and demonstrate an example implementation to get you started.
File | Contents |
---|---|
src/index.ts |
Sets up the bot app server. |
src/adapter.ts |
Sets up the bot adapter. |
src/config.ts |
Defines the environment variables. |
src/prompts/chat/skprompt.txt |
Defines the prompt. |
src/prompts/chat/config.json |
Configures the prompt. |
src/app/app.ts |
Handles business logics for the Basic AI Chatbot. |
The following are Teams Toolkit specific project files. You can visit a complete guide on Github to understand how Teams Toolkit works.
File | Contents |
---|---|
teamsapp.yml |
This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |
teamsapp.local.yml |
This overrides teamsapp.yml with actions that enable local execution and debugging. |
teamsapp.testtool.yml |
This overrides teamsapp.yml with actions that enable local execution and debugging in Teams App Test Tool. |
You can follow Build a Basic AI Chatbot in Teams to extend the Basic AI Chatbot template with more AI capabilities, like: