You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>If you want to download the sample solution, here it is (read the README first 😉): <ahref="https://github.com/michaelmaillot/teams-ai-bot-graph">Teams AI Chat Bot Graph sample</a></p>
744
-
<p>Based on a sample project generated by Teams Toolkit, the solution contains everything to run "locally" (there're still Entra IDs generated on the fly + a dev tunnel visible from <ahref="https://dev.botframework.com/bots">BotFramework site</a> + Azure AI resources).</p>
743
+
<p>If you want to download the sample solution, here it is (read the README first 😉): <ahref="https://github.com/michaelmaillot/teams-ai-bot-graph"target="_blank">Teams AI Chat Bot Graph sample</a></p>
744
+
<p>Based on a sample project generated by Teams Toolkit, the solution contains everything to run "locally" (there're still Entra IDs generated on the fly + a dev tunnel visible from <ahref="https://dev.botframework.com/bots"target="_blank">BotFramework site</a> + Azure AI resources).</p>
745
745
<p>It also provides everything to deploy the bot on Azure. The only resources not provided by default are the Azure OpenAI service and the Azure AI Content Safety, which have to be provided in the <em>env</em> files (both git tracked and untracked / private ones, in the <em>local</em> and <em>dev</em> environments).</p>
746
746
<p>Even if this article is focused on <em>local</em> env, the featured sample is ready-to-use for <em>dev</em> one if you add and fill <em>.env.dev.user</em> file. More info regarding Teams Toolkit environment configuration can be found <ahref="https://learn.microsoft.com/microsoftteams/platform/toolkit/teamsfx-preview-and-customize-app-manifest?WT.mc_id=M365-MVP-5005200" target="_blank">here</a>.</p>
<li>Running the <code>teamsapp.local.yml</code> file</li>
756
756
<li>Provisioning<ol>
757
-
<li><code>teamsApp/create</code>: Creating the Teams App for deployment (see <ahref="https://dev.teams.microsoft.com/apps">Teams Developer Portal</a>)</li>
757
+
<li><code>teamsApp/create</code>: Creating the Teams App for deployment (see <ahref="https://dev.teams.microsoft.com/apps"target="_blank">Teams Developer Portal</a>)</li>
758
758
<li><code>botAadApp/create</code>: Creating the Entra ID app that will handle the bot<ol>
759
759
<li>Writing the generated info in the <em>.env.local</em> & <em>.env.local.user</em> files</li>
760
760
</ol>
761
761
</li>
762
-
<li><code>botFramework/create</code>: Registering the bot on the <ahref="https://dev.botframework.com/">Bot Framework developer portal</a><ol>
762
+
<li><code>botFramework/create</code>: Registering the bot on the <ahref="https://dev.botframework.com/"target="_blank">Bot Framework developer portal</a><ol>
763
763
<li>Including the bot Entra ID, messaging endpoint, Teams channel</li>
<li><code>teamsApp/zipAppPackage</code>: Packaging the Teams App with manifest and icons</li>
779
779
<li><code>teamsApp/validateAppPackage</code>: Validating Teams App package</li>
780
-
<li><code>teamsApp/update</code>: Adding or updating Teams App on the <ahref="https://dev.teams.microsoft.com/apps">Teams Developer Portal</a></li>
780
+
<li><code>teamsApp/update</code>: Adding or updating Teams App on the <ahref="https://dev.teams.microsoft.com/apps"target="_blank">Teams Developer Portal</a></li>
<p>Of course by default, the Azure AI built-in content filtering system included in the Azure OpenAI deployment will work and will trigger the following message:</p>
1627
1627
<blockquote>
1628
-
<p>The bot encountered unhandled error: The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: https://go.microsoft.com/fwlink/?linkid=2198766</p>
1628
+
<p>The bot encountered unhandled error: The response was filtered due to the prompt triggering Azure OpenAI's content management policy. Please modify your prompt and retry. To learn more about our content filtering policies please read our documentation: <ahref="https://go.microsoft.com/fwlink/?linkid=2198766" target="_blank">https://go.microsoft.com/fwlink/?linkid=2198766</a></p>
1629
1629
</blockquote>
1630
1630
<p>But what we want here is to handle the moderation through the app, in order to trigger specific action or send a custom message to the user.</p>
1631
1631
<p>Another cool built-in features in Teams AI is content filtering system. We can reference Azure AI Content Safety resources to better handle both input and output. Detailed documentation about content filtering can be found <ahref="https://learn.microsoft.com/azure/ai-services/openai/concepts/content-filter?WT.mc_id=M365-MVP-5005200" target="_blank">here</a>.</p>
<p>As the documentation provided on Microsoft Learn is lightweight at the time I wrote this article, there are more info directly in the source code, like <ahref="https://github.com/microsoft/teams-ai/blob/main/js/packages/teams-ai/src/planners/LLMClient.ts#L135">here</a> or <ahref="https://github.com/microsoft/teams-ai/blob/main/js/packages/teams-ai/src/augmentations/MonologueAugmentation.ts#L103">here</a> for example. So feel free to deep dive into the code to learn more.</p>
1874
+
<p>As the documentation provided on Microsoft Learn is lightweight at the time I wrote this article, there are more info directly in the source code, like <ahref="https://github.com/microsoft/teams-ai/blob/main/js/packages/teams-ai/src/planners/LLMClient.ts#L135"target="_blank">here</a> or <ahref="https://github.com/microsoft/teams-ai/blob/main/js/packages/teams-ai/src/augmentations/MonologueAugmentation.ts#L103" target="_blank">here</a> for example. So feel free to deep dive into the code to learn more.</p>
1875
1875
<h3id="await">Await</h3>
1876
1876
<p>Always use <code>await</code> when sending activities to the user. Otherwise, you'll face errors like this:</p>
1877
1877
<blockquote>
@@ -1890,14 +1890,14 @@ <h3 id="azure-openai-api-preview-version">Azure OpenAI API preview version</h3>
1890
1890
<p>When using a model deployment, you're referring to a version ('2023-07-01-preview', '2023-12-01-preview', '2024-02-01'...). Each new version contains new parameters, new features.</p>
1891
1891
<p>As Microsoft publish new preview versions each month, they also retire "old" ones. So be careful if you're using preview versions, you could receive an email from Microsoft, warning you that old ones will be retired:</p>
1892
1892
<p><imgalt="Azure OpenAI API preview version retirement" src="../../images/articles/20240327/teams-ai-azure-openai-api-retirement.png" /></p>
1893
-
<p>More info regarding API version deprecation <ahref="https://learn.microsoft.com/azure/ai-services/openai/api-version-deprecation?WT.mc_id=M365-MVP-5005200">here</a></p>
1893
+
<p>More info regarding API version deprecation <ahref="https://learn.microsoft.com/azure/ai-services/openai/api-version-deprecation?WT.mc_id=M365-MVP-5005200"target="_blank">here</a></p>
1894
1894
<h2id="personal-feedback">Personal feedback</h2>
1895
1895
<p>During my tests, at first I found that the <code>monologue</code> augmentation was the best for my use case. But then I realized that the <code>sequence</code> one could benefit from the completion feature which can provide answers if we give it context variables needed to perform actions. Useful if you require info that doesn't need to be queried.</p>
1896
1896
<p>As I'm not a prompt expert neither an LLM or a Teams AI one, I've probably missed some key points on how to leverage the library as its best. But I'm really surprised how far we can go with this library and I'm looking forward to other's feedback!</p>
1897
1897
<h2id="thats-it">That's it</h2>
1898
1898
<p>We've seen on the surface that Teams AI is a really powerful library but needs extra documentation beyond available samples. Below some personal expectations regarding new features:</p>
1899
1899
<ul>
1900
-
<li>Support of stream mode (even if not part of Teams Client natively): <ahref="https://github.com/microsoft/teams-ai/issues/185">https://github.com/microsoft/teams-ai/issues/185</a></li>
1900
+
<li>Support of stream mode (even if not part of Teams Client natively): <ahref="https://github.com/microsoft/teams-ai/issues/185"target="_blank">https://github.com/microsoft/teams-ai/issues/185</a></li>
1901
1901
<li>Native support of text-to-image & image-to-text models, such as Dall-E</li>
1902
1902
<li>OpenAI spec support as additional augmentation</li>
0 commit comments