This template showcases the Space AI Search sample that responds to user questions like an AI assistant according to your space data from Azure AI Search. This enables your users to talk with the AI assistant in Teams to find information.
Learn more about this sample by watching this Doodle to Code video:
The app template is built using the Teams AI library, which provides the capabilities to build AI-based Teams applications.
Prerequisites
To run the sample in your local dev machine, you will need:
- Python, version 3.8 to 3.11.
- Python extension, version v2024.0.1 or higher.
- Teams Toolkit Visual Studio Code Extension latest version or Teams Toolkit CLI.
- An account with Azure OpenAI.
- An Azure AI Search service and an Azure OpenAI Service.
- Node.js (supported versions: 16, 18) for local debug in Test Tool.
- Open the command box and enter
Python: Create Environment
to create and activate your desired virtual environment. Remember to selectsrc/requirements.txt
as dependencies to install when creating the virtual environment. - In env folder, create a file env/.env.testtool, and paste the following snippet in the file
TEAMSFX_ENV=testtool
TEAMSAPPTESTER_PORT=56150
TEAMSFX_NOTIFICATION_STORE_FILENAME=.notification.testtoolstore.json
1.In env folder, create a file env/.env.testtool.user, and paste the following snippet in the file and fill the required environment variables:
SECRET_BOT_PASSWORD=
SECRET_AZURE_OPENAI_API_KEY='<YOUR-AZURE-OPENAI-API-KEY>'
AZURE_OPENAI_MODEL_DEPLOYMENT_NAME='<YOUR-AZURE-OPENAI-DEPLOYMENT-MODEL-NAME>'
AZURE_OPENAI_ENDPOINT='<YOUR-AZURE-OPENAI-ENDPOINT>'
AZURE_OPENAI_EMBEDDING_DEPLOYMENT='<YOUR-AZURE-OPENAI-EMBEDDING-MODEL>'
SECRET_AZURE_SEARCH_KEY='<YOUR-AZURE-AI-SEARCH-KEY>'
AZURE_SEARCH_ENDPOINT='<YOUR-AZURE-AI-SEARCH-ENDPOINT>'
- Open the terminal in the project root and use command
python src/indexers/setup.py
to create index and upload documents insrc/indexers/data
. - You will see the following information indicated the success of setup:
Create index succeeded. If it does not exist, wait for 5 seconds... Upload new documents succeeded. If they do not exist, wait for several seconds... setup finished
- Once you're done using the sample it's good practice to delete the index. You can do so with the command
python src/indexers/delete.py
.
- Select the Teams Toolkit icon on the left in the VS Code toolbar.
- Press F5 to start debugging which launches your app in Teams App Test Tool using a web browser. Select
Debug in Test Tool (Preview)
. - Type "Hi" or similar and you will receive a welcome message from the bot, or send any message to get a response.
Congratulations! You are running the Space AI Search that can now interact with users: