अपना फ़ीडबैक साझा करें:
हम Microsoft Teams डेवलपर दस्तावेज़ों पर आपकी प्रतिक्रिया चाहते हैं। कृपया हमारे छोटे तीन-प्रश्न सर्वेक्षण का उत्तर दें।सर्वेक्षण करें
यह ब्राउज़र अब समर्थित नहीं है.
नवीनतम सुविधाओं, सुरक्षा अपडेट और तकनीकी सहायता का लाभ लेने के लिए Microsoft Edge में अपग्रेड करें.
Get started with Teams AI library using the LightBot sample, which is designed to help you through the process of creating apps that can control lights, such as turning them on and off using Teams AI library. The bot uses the gpt-3.5-turbo model to chat with Microsoft Teams users and respond in a polite and respectful manner, staying within the scope of the conversation.
Prerequisites
To get started, ensure that you have the following tools:
First create your OpenAI API key to use OpenAI's GPT. If you want to host your app or access resources in Microsoft Azure, you must create an Azure OpenAI service.
If you've already run the samples before or encountered a runtime error, follow these steps to start fresh:
Check all the .env and env/.env.*.* files in the sample and delete any automatically populated values to ensure that Teams Toolkit generates new resources for you.
If you don’t want Teams Toolkit to generate the app ID and password, update the BOT_ID and BOT_PASSWORD in the .env file with your own values.
Remove values or leave the values blank for SECRET_BOT_PASSWORD and TEAMS_APP_UPDATE_TIME in the .env file to avoid conflicts.
Teams Toolkit automatically provisions BOT_ID and BOT_PASSWORD resources. If you want to use your own resources, you need to manually add them to the .env file. Teams Toolkit doesn't auto-generate the following resources:
An Azure OpenAI or OpenAI key
A database or similar storage options
Build and run the sample app
Get started with Teams AI library using the LightBot sample. It enables your computer’s localhost to quickly execute a Teams AI library-based sample.
Go to the location where you cloned teams-ai repo and select the teams-ai folder.
Select Select Folder.
Select View > Terminal. A terminal window opens.
In the terminal window, run the following command to go to the js folder:
terminal
cd .\js\
Run the following command to install dependencies:
terminal
yarn install
Run the following command to build dependencies:
terminal
yarn build
After the dependencies are installed, select File > Open Folder.
Go to teams-ai > js > samples> 03.ai-concepts> c.actionMapping-lightBot and select Select Folder. All the files for the LightBot sample are listed under the EXPLORER section in Visual Studio Code.
Update the following steps based on the AI services you select.
A browser tab opens the Teams web client to add the bot to your tenant.
Select Add.
When the app is added, a dialog to select the required scope appears.
Select Open to open the app in personal scope.
Alternatively, you can either search and select the required scope or select a channel, chat, or meeting from the list, and move through the dialog to select Go.
A chat window opens.
In the message compose area, send a message to invoke the bot.
नोट
If you're building a bot for the first time, it's recommended to use Teams Toolkit extension for Visual Studio Code to build a bot, see build your first bot app using JavaScript.
Prerequisites
To get started, ensure that you have the following tools:
First create your OpenAI API key to use OpenAI's GPT. If you want to host your app or access resources in Microsoft Azure, you must create an Azure OpenAI service.
If you've already run the samples before or encountered a runtime error, follow these steps to start fresh:
Check all the .env and env/.env.*.* files in the sample and delete any automatically populated values to ensure that Teams Toolkit generates new resources for you.
If you don’t want Teams Toolkit to generate the app ID and password, update the MicrosoftAppId and MicrosoftAppPassword in the .env file with your own values.
Remove values or leave the values blank for SECRET_BOT_PASSWORD and TEAMS_APP_UPDATE_TIME in the .env file to avoid conflicts.
Teams Toolkit automatically provisions MicrosoftAppId and MicrosoftAppPassword resources. If you want to use your own resources, you need to manually add them to the .env file. Teams Toolkit doesn't auto-generate the following resources:
Go to Prompts/sequence/skprompt.txt and update the following code in skprompt.txt file:
skprompt.txt
The following is a conversation with an AI assistant.
The assistant can turn a light on or off.
The assistant must return the following JSON structure:
{"type":"plan","commands":[{"type":"DO","action":"<name>","entities":{"<name>":<value>}},{"type":"SAY","response":"<response>"}]}
The following actions are supported:
- LightsOn
- LightsOff
- Pause time=<duration in ms>
- LightStatus
The lights are currently {{getLightStatus}}.
Always respond in the form of a JSON based plan. Stick with DO/SAY.
In the debug dropdown menu, select Dev Tunnels > Create a Tunnel...
Select the Account to use to create the tunnel. Azure, Microsoft Account (MSA), and GitHub accounts are supported. Update the following options:
Name: Enter a name for the tunnel.
Tunnel Type: Select Persistent or Temporary.
Access: Select Public.
Select OK. Visual Studio displays a confirmation message that a tunnel is created.
The tunnel you created is listed under Dev Tunnels > (name of the tunnel).
Go to Solution Explorer and select your project.
Right-click menu and select Teams Toolkit > Prepare Teams App Dependencies.
If prompted, sign in to your Microsoft 365 account. You receive a message that Teams app dependencies are successfully prepared.
Select OK.
Select F5 or select Debug > Start.
Select Add to add the bot to your tenant.
When the app is added, a dialog to select the required scope appears.
Select Open to open the app in personal scope.
Alternatively, you can either search and select the required scope or select a channel, chat, or meeting from the list, and move through the dialog to select Go.
A chat window opens.
In the message compose area, send a message to invoke the bot.
You can also deploy the samples to Azure using Teams Toolkit. To deploy, follow these steps:
In Visual Studio, go to Solution Explorer and select your project.
Right-click menu and select Teams Toolkit > Provision in the Cloud. Toolkit provisions your sample to Azure.
Right-click menu and select Teams Toolkit > Deploy to the Cloud.
Prerequisites
To get started, ensure that you have the following tools:
First create your OpenAI API key to use OpenAI's GPT. If you want to host your app or access resources in Microsoft Azure, you must create an Azure OpenAI service.
If you've already run the samples before or encountered a runtime error, follow these steps to start fresh:
Check all the .env and env/.env.*.* files in the sample and delete any automatically populated values to ensure that Teams Toolkit generates new resources for you.
If you don’t want Teams Toolkit to generate the app ID and password, update the BOT_ID and BOT_PASSWORD in the .env file with your own values.
Remove values or leave the values blank for SECRET_BOT_PASSWORD and TEAMS_APP_UPDATE_TIME in the .env file to avoid conflicts.
Teams Toolkit automatically provisions BOT_ID and BOT_PASSWORD resources. If you want to use your own resources, you need to manually add them to the .env file. Teams Toolkit doesn't auto-generate the following resources:
Go to the folder where you cloned the repository and select 04.ai.c.actionMapping.lightBot. All the files for the LightBot sample are listed under the EXPLORER section in Visual Studio Code.
Under EXPLORER, duplicate the sample.env file and update the duplicate file to .env.
To install the following dependencies, go to View > Terminal and run the following commands:
Dependencies
Command
python-dotenv
pip install python-dotenv
load-dotenv
pip install load-dotenv
teams-ai
pip install teams-ai
botbuilder-core
pip install botbuilder-core
Update config.json and bot.py with your model deployment name.
Go to View > Command Palette... or select Ctrl+Shift+P.
Enter Python: Create Environment to create a virtual environment.
To debug your app, select F5.
A browser tab opens the Teams web client to add the bot to your tenant.
Select Add.
When the app is added, a dialog to select the required scope appears.
Select Open to open the app in personal scope.
Alternatively, you can either search and select the required scope or select a channel, chat, or meeting from the list, and move through the dialog to select Go.
A chat window opens.
In the message compose area, send a message to invoke the bot.
Additional tools
You can also use the following tools to run and set up a sample:
Teams Toolkit CLI: You can use the Teams Toolkit CLI to create and manage Teams apps from the command line. For more information, see Teams Toolkit CLI set up instructions.
Bot Framework Emulator: The Bot Framework Emulator is a desktop application that allows you to test and debug your bot locally. You can connect to your bot by entering the bot’s endpoint URL and Microsoft app ID and password. You can then send messages to your bot and see its responses in real-time. For more information, see Bot Framework Emulator set up instructions.
Manual setup: If you prefer to set up your resources manually, you can do so by following the instructions provided by the respective services. For more information, see manual set up instructions.
Next step
Choose one of the following as a next step:
If you want to learn how to use Teams AI library to create an AI-powered bot, select the following: Build with Teams AI library
If you want to build a a custom engine agent using Teams Toolkit, select the following: Build a custom engine agent
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.
Platform Docs प्रतिक्रिया
Platform Docs एक ओपन सोर्स प्रोजेक्ट है. प्रतिक्रिया प्रदान करने के लिए लिंक का चयन करें:
Teams Toolkit is an extension for Visual Studio Code and Visual Studio 2022. It helps developers create and deploy Teams apps with integrated identity, cloud storage and other services across Microsoft 365 and Azure. In this Learn path, you'll learn how to build a Microsoft Teams app using Teams Toolkit for Visual Studio Code.
Learn about Teams AI library, Teams-centric component scaffolding, natural language modeling, prompt engineering, LLM, action planner, assistants API, augmentation.