Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into lilydu/py-streaming
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyydu committed Oct 23, 2024
2 parents 8ac9bc2 + 70a0746 commit 2fc22cf
Show file tree
Hide file tree
Showing 90 changed files with 2,423 additions and 1,725 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Test
run: dotnet test Microsoft.TeamsAI.Tests/Microsoft.Teams.AI.Tests.csproj --verbosity normal --logger trx --results-directory ./TestResults --collect:"XPlat Code Coverage" --configuration Release
- name: Coverage
uses: danielpalme/ReportGenerator-GitHub-Action@b7115d212c0f7814a0cb17fb43ec36983c707ccb # 5.3.10
uses: danielpalme/ReportGenerator-GitHub-Action@62f9e70ab348d56eee76d446b4db903a85ab0ea8 # 5.3.11
with:
reports: ${{ env.SOLUTION_DIR }}TestResults/*/coverage.cobertura.xml
targetdir: ${{ env.SOLUTION_DIR }}TestResults/coverage
Expand All @@ -84,7 +84,7 @@ jobs:
parallel: true
files: ${{ env.SOLUTION_DIR }}TestResults/coverage/lcov.info
- name: Upload Tests
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: testresults-dotnet-${{ env.dotnet-version }}
path: ${{ env.SOLUTION_DIR }}TestResults
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dotnet-build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ jobs:
- name: Test
run: dotnet test Microsoft.TeamsAI.Tests/Microsoft.Teams.AI.Tests.csproj --no-restore --verbosity normal --logger trx --results-directory ./TestResults --collect:"XPlat Code Coverage" --configuration Release
- name: Coverage
uses: danielpalme/ReportGenerator-GitHub-Action@b7115d212c0f7814a0cb17fb43ec36983c707ccb # 5.3.10
uses: danielpalme/ReportGenerator-GitHub-Action@62f9e70ab348d56eee76d446b4db903a85ab0ea8 # 5.3.11
with:
reports: ${{ env.SOLUTION_DIR }}TestResults/*/coverage.cobertura.xml
targetdir: ${{ env.SOLUTION_DIR }}TestResults/coverage
reporttypes: 'HtmlInline;lcov'
toolpath: ${{ env.SOLUTION_DIR }}report-generator-tool
- name: Upload Tests
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: testresults-dotnet-${{ matrix.dotnet-version }}
path: ${{ env.SOLUTION_DIR }}TestResults
Expand Down
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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Initialize CodeQL
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
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@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
category: "/language:csharp"
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
- name: Publish
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/microsoft/index.json --skip-duplicate --no-symbols
- name: Upload
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: nupkg-dotnet-${{ matrix.dotnet-version }}
path: dotnet/packages/Microsoft.TeamsAI/*.nupkg
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@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Initialize CodeQL
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
category: "/language:javascript"
4 changes: 2 additions & 2 deletions .github/workflows/python-codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
- name: Initialize CodeQL
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/init@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/analyze@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
category: "/language:python"
4 changes: 2 additions & 2 deletions .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
uses: github/codeql-action/upload-sarif@f779452ac5af1c261dce0346a8f964149f49322b # v3.26.13
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ This project may contain trademarks or logos for projects, products, or services
trademarks or logos is subject to and must follow
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
Any use of third-party trademarks or logos are subject to those third-party's policies.
Any use of third-party trademarks or logos is subject to those third parties' policies.

## Accessing daily builds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public static class AIConstants
/// <summary>
/// The type of command that will stop the running.
/// </summary>
/// <remarks>
/// This command is incompatible and should not be used with `tools` augmentation
/// </remarks>
public const string StopCommand = "STOP";

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public async Task<string> SayCommandAsync([ActionTurnContext] ITurnContext turnC
int i = 0;
foreach (Citation citation in command.Response.Context.Citations)
{
string abs = CitationUtils.Snippet(citation.Content, 480);
string abs = CitationUtils.Snippet(citation.Content, 477);
if (isTeamsChannel)
{
content.Replace("\n", "<br>");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>Microsoft.Teams.AI</PackageId>
<Product>Microsoft Teams AI SDK</Product>
<Version>1.7.0</Version>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageDescription>SDK focused on building AI based applications for Microsoft Teams.</PackageDescription>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/microsoft/teams-ai</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<!-- Rules found at: https://aka.ms/Microsoft-NuGet-Compliance -->
<PackageProjectUrl>https://github.com/microsoft/teams-ai</PackageProjectUrl>
<PackageIconUrl>https://github-production-user-asset-6210df.s3.amazonaws.com/14900841/240368384-972a9a1b-679a-4725-bfc0-a1e76151a78a.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>bots;ai;teams</PackageTags>
<!--
Suppress a warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported,
replace PackageLicenseUrl with PackageLicenseExpression.
-->
<NoWarn>NU5125</NoWarn>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AdaptiveCards" Version="3.1.0" />
<PackageReference Include="Azure.AI.ContentSafety" Version="1.0.0-beta.1" />
<PackageReference Include="Azure.AI.OpenAI" Version="2.0.0-beta.5" />
<PackageReference Include="JsonSchema.Net" Version="5.5.1" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.22.9" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.22.9" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.22.9" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.ML.Tokenizers" Version="0.22.0-preview.24271.1" />
<PackageReference Include="OpenAI" Version="2.0.0-beta.11" />
<PackageReference Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
<None Include="C:\Users\kavinsingh\source\repos\teams-ai\dotnet\packages\Microsoft.TeamsAI\Microsoft.TeamsAI\.editorconfig" />
</ItemGroup>

<ItemGroup>
<EditorConfigFiles Remove="C:\Users\kavinsingh\source\repos\teams-ai\dotnet\packages\Microsoft.TeamsAI\Microsoft.TeamsAI\.editorconfig" />
</ItemGroup>

</Project>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>Microsoft.Teams.AI</PackageId>
<Product>Microsoft Teams AI SDK</Product>
<Version>1.7.0</Version>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageDescription>SDK focused on building AI based applications for Microsoft Teams.</PackageDescription>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/microsoft/teams-ai</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<!-- Rules found at: https://aka.ms/Microsoft-NuGet-Compliance -->
<PackageProjectUrl>https://github.com/microsoft/teams-ai</PackageProjectUrl>
<PackageIconUrl>https://github-production-user-asset-6210df.s3.amazonaws.com/14900841/240368384-972a9a1b-679a-4725-bfc0-a1e76151a78a.png</PackageIconUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageTags>bots;ai;teams</PackageTags>
<!--
Suppress a warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported,
replace PackageLicenseUrl with PackageLicenseExpression.
-->
<NoWarn>NU5125</NoWarn>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AdaptiveCards" Version="3.1.0" />
<PackageReference Include="Azure.AI.ContentSafety" Version="1.0.0-beta.1" />
<PackageReference Include="Azure.AI.OpenAI" Version="2.0.0-beta.5" />
<PackageReference Include="JsonSchema.Net" Version="5.5.1" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Bot.Builder" Version="4.22.9" />
<PackageReference Include="Microsoft.Bot.Builder.Dialogs" Version="4.22.9" />
<PackageReference Include="Microsoft.Bot.Builder.Integration.AspNet.Core" Version="4.22.9" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.61.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Microsoft.ML.Tokenizers" Version="0.22.0-preview.24271.1" />
<PackageReference Include="OpenAI" Version="2.0.0-beta.11" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
</ItemGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\" />
<None Include="C:\Users\kavinsingh\source\repos\teams-ai\dotnet\packages\Microsoft.TeamsAI\Microsoft.TeamsAI\.editorconfig" />
</ItemGroup>

<ItemGroup>
<EditorConfigFiles Remove="C:\Users\kavinsingh\source\repos\teams-ai\dotnet\packages\Microsoft.TeamsAI\Microsoft.TeamsAI\.editorconfig" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions getting-started/CONCEPTS/ACTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ An action handler is a callback function that is called when an action is trigge

- If the result is a non-empty string, that string is included as the output of the action to the plan. The last output can be accessed in the next triggered action via the state object: `state.temp.lastOutput`.
- If the action handler returns `AI.StopCommandName`, the `run` method will terminate execution.
> **Note:** `AI.StopCommandName` does not work with `tools` augmentation!
- If the result is an empty string and there is a list of predicted commands, the next command in the plan is executed.
- In sequence augmentation, the returned string is appended to the prompt at runtime (see Sequence [Augmentations](./AUGMENTATIONS.md)). This is then used to generate the plan object using defined actions.
- In monologue augmentation, the returned string is used as inner monologue to perform chain-of-thought reasoning by appending instructions to the prompt during runtime (see Monologue [Augmentation](./AUGMENTATIONS.md)). This is for predicing the next action to execute.
Expand Down
6 changes: 5 additions & 1 deletion getting-started/CONCEPTS/STREAMING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ Once `endStream()` is called, the stream is considered ended and no further upda

### Current Limitations:
- Streaming is only available in 1:1 chats.
- SendActivity requests are restricted to 1 RPS. Our SDK buffers to 1.5 seconds.
- For Powered by AI features, only the Feedback Loop and Generated by AI Label is currently supported.
- Only rich text can be streamed.
- Due to future GA protocol changes, the `channelData` metadata must be included in the `entities` object as well.
- Only one informative message can be set. This is reused for each message.
- Examples include:
- “Scanning through documents”
Expand All @@ -70,7 +73,8 @@ You can configure streaming with your bot by following these steps:


#### Optional additions:
- Set the informative message in the `ActionPlanner` declaration via the `StartStreamingMessage` config.
- Set the informative message in the `ActionPlanner` declaration via the `StartStreamingMessage` config.
- As previously, set the feedback loop toggle in the `AIOptions` object in the `app` declaration and specify a handler.
- Set attachments in the final chunk via the `EndStreamHandler` in the `ActionPlanner` declaration.

#### C#
Expand Down
10 changes: 5 additions & 5 deletions js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
},
"dependencies": {
"botbuilder": "^4.23.1",
"openai": "4.61.0"
"openai": "4.68.2"
},
"devDependencies": {
"@azure/logger": "^1.1.4",
"@azure/ms-rest-js": "2.7.0",
"@microsoft/api-extractor": "^7.47.7",
"@microsoft/api-extractor": "^7.47.11",
"@standardlabs/is-private": "^1.0.1",
"@types/jsonwebtoken": "9.0.4",
"@types/lodash": "^4.17.10",
"@types/mocha": "^10.0.7",
"@types/lodash": "^4.17.12",
"@types/mocha": "^10.0.9",
"@types/node": "^20.16.1",
"@types/sinon": "^10.0.19",
"@typescript-eslint/eslint-plugin": "^6.21.0",
Expand All @@ -46,7 +46,7 @@
"eslint-plugin-only-warn": "^1.1.0",
"eslint-plugin-prettier": "^5.2.1",
"exorcist": "^2.0.0",
"express": "^4.20.0",
"express": "^4.21.1",
"mocha-junit-reporter": "^2.0.0",
"mocha": "^10.7.3",
"ms-rest-azure": "^3.0.2",
Expand Down
20 changes: 10 additions & 10 deletions js/packages/teams-ai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@microsoft/teams-ai",
"author": "Microsoft Corp.",
"description": "SDK focused on building AI based applications for Microsoft Teams.",
"version": "1.5.1",
"version": "1.5.3",
"license": "MIT",
"keywords": [
"botbuilder",
Expand All @@ -25,22 +25,22 @@
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"peerDependencies": {
"botbuilder": "^4.23.0",
"openai": "^4.61.0"
"botbuilder": "^4.23.1",
"openai": "^4.68.2"
},
"dependencies": {
"@azure/openai-assistants": "1.0.0-beta.6",
"@azure/msal-node": "^2.15.0",
"axios": "^1.7.5",
"botbuilder-dialogs": "^4.23.1",
"botframework-connector": "^4.23.0",
"botframework-schema": "^4.23.0",
"botframework-streaming": "^4.23.0",
"gpt-tokenizer": "^2.4.1",
"botframework-connector": "^4.23.1",
"botframework-schema": "^4.23.1",
"botframework-streaming": "^4.23.1",
"gpt-tokenizer": "^2.5.1",
"json-colorizer": "^2.2.2",
"jsonschema": "1.4.1",
"uuid": "^9.0.1",
"yaml": "^2.5.1"
"yaml": "^2.6.0"
},
"resolutions": {
"follow-redirects": "^1.15.0"
Expand All @@ -49,12 +49,12 @@
"@types/assert": "^1.5.10",
"@types/express": "^4.17.21",
"@types/jsonwebtoken": "^9.0.4",
"@types/mocha": "^10.0.7",
"@types/mocha": "^10.0.9",
"@types/node": "^20.16.1",
"@types/uuid": "^9.0.8",
"botbuilder-core": "^4.22.1",
"eslint": "^8.57.1",
"express": "^4.20.0",
"express": "^4.21.1",
"jsonwebtoken": "^9.0.2",
"mocha": "10.7.3",
"nyc": "^15.1.0",
Expand Down
Loading

0 comments on commit 2fc22cf

Please sign in to comment.