Skip to content

Commit

Permalink
Merge branch 'chyuan/csharp-ut' of https://github.com/microsoft/teams-ai
Browse files Browse the repository at this point in the history
 into chyuan/csharp-ut
  • Loading branch information
blackchoey committed Jan 3, 2024
2 parents 3a49a7c + ec3eb94 commit 9e0755a
Show file tree
Hide file tree
Showing 20 changed files with 245 additions and 423 deletions.
57 changes: 0 additions & 57 deletions .github/ISSUE_TEMPLATE/bug-report-template.md

This file was deleted.

53 changes: 53 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug"]
projects: ["microsoft/719"]
body:
- type: markdown
attributes:
value: |
**Please note: any submissions with insufficient reproducible information will be marked as 'Waiting for customer input' and may be closed is there is no response**
- type: dropdown
id: language
attributes:
label: Language
description: Which language are you using?
multiple: true
options:
- Javascript/Typescript
- C#
- Python
default: 0
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: Which version are you using?
placeholder: Version...
value: latest
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: Provide a clear and concise description of what the bug is.
placeholder: Description...
validations:
required: true
- type: textarea
id: repro
attributes:
label: Reproduction Steps
description: How do you trigger this bug? Please walk us through it step by step.
value: |
1.
2.
3.
...
render: bash
validations:
required: true
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
25 changes: 0 additions & 25 deletions .github/ISSUE_TEMPLATE/feature-request-template.md

This file was deleted.

34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Feature Request
description: Suggest an idea for this project
title: "[Feature Request]: "
labels: ["enhancement"]
projects: ["microsoft/719"]
body:
- type: markdown
attributes:
value: |
**Please note: any submissions with insufficient reproducible information will be marked as 'Waiting for customer input' and may be closed is there is no response**
- type: textarea
id: scenario
attributes:
label: Scenario
description: Provide a clear and concise description of what the problem is. Ex. I'm always frustrated when [...].
placeholder: Scenario...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Solution
description: Provide a clear and concise description of what you want to happen, with code snippets or pseudo code as applicable.
placeholder: Solution...
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional Context
description: Add any other context or screenshots about the feature request here.
placeholder: Additional Context...
validations:
required: false
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Initialize CodeQL
uses: github/codeql-action/init@b374143c1149a9115d881581d29b8390bbcbb59c # v3.22.11
uses: github/codeql-action/init@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
languages: csharp
- name: Setup .NET
Expand All @@ -50,6 +50,6 @@ jobs:
working-directory: dotnet/packages/Microsoft.TeamsAI/
run: dotnet build Microsoft.Teams.AI.sln --configuration Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b374143c1149a9115d881581d29b8390bbcbb59c # v3.22.11
uses: github/codeql-action/analyze@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
category: "/language:csharp"
4 changes: 2 additions & 2 deletions .github/workflows/js-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Initialize CodeQL
uses: github/codeql-action/init@b374143c1149a9115d881581d29b8390bbcbb59c # v3.22.11
uses: github/codeql-action/init@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@b374143c1149a9115d881581d29b8390bbcbb59c # v3.22.11
uses: github/codeql-action/analyze@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
category: "/language:javascript"
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@b374143c1149a9115d881581d29b8390bbcbb59c # v3.22.11
uses: github/codeql-action/upload-sarif@012739e5082ff0c22ca6d6ab32e07c36df03c4a4 # v3.22.12
with:
sarif_file: results.sarif
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
# <image src="https://github.com/microsoft/teams-ai/assets/14900841/972a9a1b-679a-4725-bfc0-a1e76151a78a" height="10%" width="10%" /> Teams AI Library
# ![teams logo](https://github.com/microsoft/teams-ai/assets/14900841/10a0fbac-9d31-46d5-ad65-0eeb33b787a8) Teams AI Library

[![Build Status](https://dev.azure.com/DomoreexpGithub/Github_Pipelines/_apis/build/status%2Fteams-ai%2Fmicrosoft.teams-ai?branchName=main)](https://dev.azure.com/DomoreexpGithub/Github_Pipelines/_build/latest?definitionId=4&branchName=main)

Welcome to the Teams AI Library! This SDK is specifically designed to assist you in creating bots capable of interacting with Teams and Microsoft 365 applications. It is constructed using the [Bot Framework SDK](https://github.com/microsoft/botbuilder-js) as its foundation, simplifying the process of developing bots that interact with Teams' artificial intelligence capabilities.

<p>
<figure>
<img src="https://github.com/microsoft/teams-ai/assets/14900841/154353ff-bafe-4423-abcd-6dc5a8680fe9" />
<figcaption>This is a diagram of the Teams-AI flow. Teams AI SDK hooks into the Teams SDK and Azure OpenAI SDK to provide a seamless experience for developers.</figcaption>
</figure>
</p>
The SDK is currently available for JavaScript/TypeScript applications in the <a href="./js" ><code>js</code></a> folder and via the <a href="https://www.npmjs.com/package/@microsoft/teams-ai">teams-ai package on NPM</a>. We are actively developing parity for .NET, which will be available soon.
![Teams AI flow diagram](https://github.com/microsoft/teams-ai/assets/14900841/154353ff-bafe-4423-abcd-6dc5a8680fe9)
This is a diagram of the Teams-AI flow. Teams AI SDK hooks into the Teams SDK and Azure OpenAI SDK to provide a seamless experience for developers.

The SDK is currently available for JavaScript/TypeScript applications in the [`js`](./js) folder and via the [teams-ai package on NPM](https://www.npmjs.com/package/@microsoft/teams-ai). .NET support is available in the [`dotnet`](./dotnet) folder and via the [teams-ai package on NuGet](https://www.nuget.org/packages/Microsoft.Teams.AI).

## Getting Started

> ### 🖇️ Jump right in❗️ 📎
>
> If you want to jump immediately into AI, try out the [04.ai.a.teamsChefbot](./js/samples/04.ai.a.teamsChefBot) sample. This sample is a simple bot that uses the OpenAI GPT model to build a Teams app. Just load it up in Visual Code and hit F5! 🎉
> If you want to jump immediately into AI, try out the [04.ai.a.teamsChefbot](./js/samples/04.ai.a.teamsChefBot) sample. This sample is a simple bot that uses the OpenAI GPT model to build a Teams app. Just load it up in Visual Studio Code, rename the sample.env file to .env, add in your OpenAI key or Azure OpenAI key and endpoint in the .env file, and hit F5! 🎉
### Start with our getting started guides

This SDK is under private preview and is subject to change. We welcome your feedback and contributions!
This SDK is now generally available. We welcome your feedback and contributions!

**To get started, head over to the [Getting Started Guide](getting-started/README.md).**

## Capabilities

### Teams-centric component scaffolding

> For examples of the below, browse through the [JS](./js/samples/) folders.
> For examples of the below, browse through the [`js`](./js/samples/) sample folders or the [`dotnet`](./dotnet/samples) sample folders.
> Simple scaffolding for any conversational app component, including:
- Chat bots
Expand All @@ -46,7 +43,9 @@ With a simple text file written in human language, you can describe the function

### Moderation

A configurable API call to filter inappropriate content for input content, output content, or both. (See [OpenAIModerator.ts](./js/src/openai/OpenAIModerator.ts))
A configurable API call to filter inappropriate content for input content, output content, or both.

(Moderators are available whether you decide to you OpenAI or Azure OpenAI for your models. If using OpenAI see [OpenAIModerator.ts](./js/packages/teams-ai/src/moderators/OpenAIModerator.ts) or [OpenAIModerator.cs](https://github.com/microsoft/teams-ai/blob/46042530f43058a815df4376f0f068f9d8d2e144/dotnet/packages/Microsoft.TeamsAI/Microsoft.TeamsAI/AI/Moderator/OpenAIModerator.cs) and for Azure's moderator see [AzureContentSaftyModerator.ts](./js/packages/teams-ai/src/moderators/AzureContentSafetyModerator.ts). Azure's moderator for C# is in development)

### Predictive Engine to Map Intents to Actions

Expand Down Expand Up @@ -77,7 +76,7 @@ This SDK is licensed under the MIT License. This SDK includes tools to use APIs

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
the rights to use your contribution. For details, visit [https://cla.opensource.microsoft.com](https://cla.opensource.microsoft.com).

For more details, see [./CONTRIBUTING.md](./CONTRIBUTING.md).

Expand Down
12 changes: 6 additions & 6 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@
"devDependencies": {
"@azure/logger": "^1.0.2",
"@azure/ms-rest-js": "2.7.0",
"@microsoft/api-extractor": "^7.38.5",
"@microsoft/api-extractor": "^7.39.0",
"@standardlabs/is-private": "^1.0.1",
"@types/jsonwebtoken": "9.0.4",
"@types/lodash": "^4.14.202",
"@types/mocha": "^10.0.6",
"@types/sinon": "^10.0.19",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"applicationinsights": "^2.9.1",
"browserify": "^17.0.0",
"chai": "^4.3.10",
"depcheck": "^1.4.7",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsdoc": "^46.9.1",
"eslint-plugin-jsdoc": "^46.10.1",
"eslint-plugin-mocha": "^10.2.0",
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-security": "^1.7.1",
"exorcist": "^2.0.0",
"mocha": "^10.2.0",
Expand All @@ -59,7 +59,7 @@
"sponge": "^0.1.0",
"tinyify": "^4.0.0",
"ts-node": "^10.9.2",
"typedoc": "^0.25.4",
"typedoc": "^0.25.6",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "^5.3.3",
"wsrun": "^5.2.4"
Expand Down
16 changes: 9 additions & 7 deletions js/packages/teams-ai/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Teams AI Library

Welcome to the Teams AI Library JavaScript package. See the [Teams AI repo README.md](https://github.com/microsoft/teams-ai), for general information, including updates on dotnet support.
Welcome to the Teams AI Library JavaScript package!

This SDK is specifically designed to assist you in creating bots capable of interacting with Teams and Microsoft 365 applications. It is constructed using the [Bot Framework SDK](https://github.com/microsoft/botbuilder-js) as its foundation, simplifying the process of developing bots that interact with Teams' artificial intelligence capabilities. See the [Teams AI repo README.md](https://github.com/microsoft/teams-ai), for general information, and .Net support is available via the [dotnet](https://github.com/microsoft/teams-ai/tree/main/dotnet) folder.

Requirements:

Expand All @@ -9,11 +11,11 @@ Requirements:

## Getting Started: Migration v.s. New Project

If you're migrating an existing project, switching to add on the Teams AI layer is quick and simple. For a more-detailed walkthrough, see the [migration guide](https://github.com/microsoft/teams-ai/blob/main/getting-started/js/00.MIGRATION.md). The basics are listed below.
If you're migrating an existing project, switching to add on the Teams AI Library layer is quick and simple. For a more-detailed walkthrough, see the [migration guide](https://github.com/microsoft/teams-ai/blob/main/getting-started/js/00.MIGRATION.md). The basics are listed below.

### Migration

In your existing Teams bot, you'll need to add the Teams AI SDK package and import it into your bot code.
In your existing Teams bot, you'll need to add the Teams AI Library SDK package and import it into your bot code.

```bash
yarn add @microsoft/teams-ai
Expand Down Expand Up @@ -47,11 +49,11 @@ That's it!

Run your bot (with ngrok) and sideload your manifest to test.

For migrating specific features such as Message Extension and Adaptive Card capabilities, please see the [Migration Guide](../../getting-started/00.MIGRATION.md).
For migrating specific features such as Message Extension and Adaptive Card capabilities, please see the [Migration Guide](https://github.com/microsoft/teams-ai/blob/main/getting-started/js/00.MIGRATION.md).

### New Project

If you are starting a new project, you can use the [Teams AI SDK echobot sample](../samples/01.messaging.a.echoBot/) as a starting point. You don't need to make any changes to the sample to get it running, but you can use it as your base setup. Echo Bot supports the Teams AI SDK out of the box.
If you are starting a new project, you can use the [Teams AI SDK echobot sample](https://github.com/microsoft/teams-ai/tree/main/js/samples/01.messaging.a.echoBot) as a starting point. You don't need to make any changes to the sample to get it running, but you can use it as your base setup. Echo Bot supports the Teams AI SDK out of the box.

You can either copy-paste the code into your own project, or clone the repo and run the Teams Toolkit features to explore.

Expand All @@ -75,7 +77,7 @@ const app = new ApplicationBuilder()<ApplicationTurnState>

## AI Setup

The detailed steps for setting up your bot to use AI are in the [GPT Setup Guide](../../../getting-started/js/01.AI-SETUP.md).
The detailed steps for setting up your bot to use AI are in the [GPT Setup Guide](https://github.com/microsoft/teams-ai/blob/main/getting-started/js/01.AI-SETUP.md).

On top of your Microsoft App Id and password, you will need an Azure OpenAI or OpenAI API key. You can get one from the [OpenAI platform](https://platform.openai.com/). Once you have your key, add it to your `.env` file as `OPEN_AI_KEY`

Expand All @@ -98,6 +100,6 @@ const app = new Application<ApplicationTurnState>({
});
```

For more information on how to create and use prompts, see [APIREFERENCE](../../../getting-started/00.PROMPTS.md) and look at the [samples](../samples/) numbered `04._.xxx`).
For more information on how to create and use prompts, see [PROMPTS](https://github.com/microsoft/teams-ai/blob/main/getting-started/00.PROMPTS.md) and look at the [samples](https://github.com/microsoft/teams-ai/tree/main/js/samples) numbered `04._.xxx`.

Happy coding!
6 changes: 3 additions & 3 deletions js/packages/teams-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
"types": "./lib/index.d.ts",
"dependencies": {
"@azure/msal-node": "^2.6.0",
"axios": "^1.6.2",
"axios": "^1.6.3",
"botbuilder": "^4.21.3",
"botbuilder-dialogs": "^4.21.3",
"gpt-3-encoder": "^1.1.4",
"json-colorizer": "^2.2.2",
"jsonschema": "1.4.1",
"openai": "^4.23.0",
"openai": "^4.24.1",
"uuid": "^9.0.1",
"yaml": "^2.3.4"
},
Expand All @@ -40,7 +40,7 @@
"@types/assert": "^1.5.10",
"@types/jsonwebtoken": "^9.0.4",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.5",
"@types/node": "^20.10.6",
"@types/uuid": "^9.0.7",
"eslint": "^8.56.0",
"jsonwebtoken": "^9.0.2",
Expand Down
Loading

0 comments on commit 9e0755a

Please sign in to comment.