Skip to content

Files

Latest commit

45ec55d · Feb 4, 2025

History

History

a.echoBot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 21, 2024
Aug 2, 2024
Aug 21, 2024
Apr 1, 2024
Apr 1, 2024
Apr 1, 2024
Apr 1, 2024
Aug 21, 2024
Apr 1, 2024
Apr 1, 2024
Dec 9, 2024
Feb 4, 2025
Apr 1, 2024
Aug 2, 2024
Aug 21, 2024
Aug 2, 2024
Apr 1, 2024
Apr 1, 2024

Teams Echo Bot

This sample shows how to incorporate a basic conversational flow into a Microsoft Teams application using Bot Framework and the Teams AI SDK.

Interacting with the bot

You can interact with the bot by messaging it and it will echo that back to you.

Setting up the sample

  1. Clone the repository

    git clone https://github.com/Microsoft/teams-ai.git

Important

To prevent issues when installing dependencies after cloning the repo, copy or move the sample directory to it's own location first.

  1. If you do not have yarn installed, install it globally

    npm install -g yarn@1.21.1
  2. In the root JavaScript folder, install and build all dependencies

    cd teams-ai/js
    # This will use the latest changes from teams-ai in the sample.
    yarn install #only needs to be run once, after clone or remote pull
    yarn build
    # To run using latest published version of teams-ai, do the following instead:
    cd teams-ai/js/samples/<this-sample-folder>
    npm install --workspaces=false
    npm run build
  3. In a terminal, navigate to the sample root.

    cd samples/<this-sample-folder>/
    yarn start
    # If running the sample on published version of teams-ai
    npm start
  4. Duplicate the sample.env file in this folder. Rename the file to .env and add your bot's credentials and any other credentials to that file. Alternatively, if you are using Teams Toolkit (see below), you can add these credentials to the /env/.env.*.* files.

Testing the sample

The easiest and fastest way to get up and running is with Teams Toolkit as your development guide.

Otherwise, if want to learn about the other ways to test a sample, use Teams Toolkit or Teams Toolkit CLI, and more, please see our documentation on different ways to run samples.

To use Teams Toolkit, continue following the directions below.

Using Teams Toolkit for Visual Studio Code

The simplest way to run this sample in Teams is to use Teams Toolkit for Visual Studio Code.

  1. Ensure you have downloaded and installed Visual Studio Code
  2. Install the Teams Toolkit extension
  3. Copy this sample into a new folder outside of teams-ai
  4. Select File > Open Folder in VS Code and choose this sample's directory
  5. Using the extension, sign in with your Microsoft 365 account where you have permissions to upload custom apps.
  6. Verify that the Teams Toolkit extension is connected to your Teams account from the above step.
  7. Select Debug > Start Debugging or F5 to run the app in a Teams web client.
  8. In the browser that launches, select the Add button to install the app to Teams..

If you do not have permission to upload custom apps (sideloading), Teams Toolkit will recommend creating and using a Microsoft 365 Developer Program account - a free program to get your own dev environment sandbox that includes Teams.

Using Teams App test tool

Use Teams App test tool (integrated into teams Toolkit) to run this sample.

  1. Ensure you have downloaded and installed Visual Studio Code
  2. Install the Teams Toolkit extension
  3. Copy this sample into a new folder outside of teams-ai
  4. Select File > Open Folder in VS Code and choose this sample's directory
  5. From the left pane, select Run and Debug(Ctrl+Shift+D) and select Debug in Test Tool in dropdown list.
  6. Select Debug > Start Debugging or F5 to run the app.
  7. The browser will pop up to open Teams App Test Tool.