Skip to content

achappey/teams-aissistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Math Tutor Assistant

Summary

This example shows how to create a basic conversational experience using OpenAI's Assistants API's. It leverages OpenAI's Code Interpreter tool to create an assistant that's an expert on math.

Set up instructions

All the samples in the C# .NET SDK can be set up in the same way. You can find the step by step instructions here: Setup Instructions.

Note that, this sample requires AI service and Assistant so you need pre-steps before Local Debug (F5).

Create new OpenAI Assistant (You can skip this step if already have one Assistant)

  1. Set your OpenAI API key to appsettings.Development.json.

      "OpenAI": {
        "ApiKey": "<your-openai-api-key>"
      }
  2. Run the code and it will create an OpenAI Assistant and output it's ID to console.

Use OpenAI Assistant

  1. Set your OpenAI API key and Assistant ID to appsettings.Development.json.

      "OpenAI": {
        "ApiKey": "<your-openai-api-key>",
        "AssistantId": "<your-openai-assistant-id>"
      }
  2. Now you can run/debug project as Teams App.

Interacting with the bot

Math Bot

Interacting with the bot is simple - talk to it! You can invoke it by using @ mention and talk to it in plain language.

Deploy to Azure

You can use Teams Toolkit for Visual Studio or CLI to host the bot in Azure. The sample includes Bicep templates in the /infra directory which are used by the tools to create resources in Azure.

You can find deployment instructions here.

Note that, this sample requires AI service so you need one more pre-step before deploy to Azure. To configure the Azure resources to have an environment variable for the OpenAI Key and other settings:

  1. In ./env/.env.dev.user file, paste your OpenAI related variables.

    SECRET_OPENAI_API_KEY=
    SECRET_OPENAI_ASSISTANT_ID=

The SECRET_ prefix is a convention used by Teams Toolkit to mask the value in any logging output and is optional.

Appendix

Here's a list of the different capabilities shown in this sample:

Bot scaffolding
Throughout the 'Program.cs' file you'll see the scaffolding created to run a simple conversational bot, e.g. storage, authentication, and conversation state.
Localization across languages
Because this sample leverages GPT for all its natural language modelling, the user can talk to an AI bot in any language of their choosing. The bot will understand and respond appropriately with no additional code required.

Further reading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published