Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
1c87817
[repo] bump: (deps): Bump the production group across 1 directory wit…
dependabot[bot] Apr 30, 2025
c9a3faf
[JS] bump: (deps-dev): Bump the development group in /js with 2 updat…
dependabot[bot] Apr 30, 2025
0fb38d2
[C#] fix: Add codesigning to .NET build pipeline (#2379)
singhk97 May 3, 2025
de02c73
[PY] bump: h11 from 0.14.0 to 0.16.0 in /python/samples/04.ai.c.actio…
dependabot[bot] May 5, 2025
0f705ab
[JS] bump: (deps-dev): Bump the development group in /js with 3 updat…
dependabot[bot] May 7, 2025
861f76d
[repo] chore: update README for v2 (#2448)
lilyydu May 7, 2025
c95ddad
[C#] fix: Fixes for custom feedback loops in .NET (#2454)
JGemkow May 13, 2025
dc20109
[C#] fix: Improve citation logic and tests for unique citations (#2462)
Krishna122022 May 14, 2025
fed310d
[JS] bump: (deps): Bump the production group across 1 directory with …
dependabot[bot] May 15, 2025
7676d69
[JS] bump: (deps-dev): Bump the development group in /js with 3 updat…
dependabot[bot] May 23, 2025
e1fa890
[C#] Bump: to v1.11.0 (#2478)
singhk97 May 27, 2025
315032d
[PY] bump: bump h11 from 0.14.0 to 0.16.0 in /python/samples/04.ai.e.…
dependabot[bot] May 27, 2025
7b7b0ee
[JS] bump: (deps-dev): Bump @types/lodash from 4.17.16 to 4.17.17 in …
dependabot[bot] May 27, 2025
a2947f3
[JS] feat: rebrand ttk (#2385)
HuihuiWu-Microsoft May 27, 2025
c9a75c6
[PY] bump: build(deps) bump requests from 2.32.2 to 2.32.4 in /python…
dependabot[bot] Jun 25, 2025
c1e36b9
[repo] docs: Added a link to "How to create and deploy models and emb…
gauravkeshre Jun 26, 2025
76e0a04
[JS] bump: Bump the production group across 1 directory with 3 update…
dependabot[bot] Jun 30, 2025
110a625
[repo] bump: (deps): Bump the production group across 1 directory wit…
dependabot[bot] Jun 30, 2025
78e2bf5
[PY] fix: fix issue chat History Limitation Problem (#2520)
hoantran1107 Jul 1, 2025
c9bc07c
[PY] bump: urllib3 from 1.26.19 to 2.5.0 in /python/samples/04.ai.b.m…
dependabot[bot] Jul 1, 2025
366b5a0
[PY] bump: patch to 1.8.1 (#2523)
lilyydu Jul 1, 2025
c818d49
[repo] bump: (deps): Bump the production group with 2 updates (#2519)
dependabot[bot] Jul 2, 2025
43e6f98
[PY] bump: urllib3 from 1.26.19 to 2.5.0 in /python/samples/04.ai.e.c…
dependabot[bot] Jul 2, 2025
2ae4c42
[repo] fix: add url to ClientCitations (#2528)
tianjing-li Jul 15, 2025
8fe3a55
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/04.ai.g.a…
dependabot[bot] Aug 4, 2025
4ea4a65
[PY] bump: aiohttp from 3.9.3 to 3.12.14 in /python/samples/06.auth.o…
dependabot[bot] Aug 4, 2025
ed0bd1d
[PY] bump: aiohttp from 3.10.5 to 3.12.14 in /python/packages/ai (#2537)
dependabot[bot] Aug 4, 2025
453cc57
[C#] bump: Bump the development group with 8 updates (#2548)
dependabot[bot] Aug 5, 2025
cfb2fff
[C#] bump: Bump Azure.Identity and 3 others (#2549)
dependabot[bot] Aug 5, 2025
ce0427f
[C#] bump: Bump the development group with 2 updates (#2559)
dependabot[bot] Aug 20, 2025
e0c2be3
[JS] feat: #2560 Add max_completion_tokens handling for gpt-5 (#2561)
mlcruz Aug 20, 2025
f793c5e
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/06.assist…
dependabot[bot] Sep 8, 2025
6c8acc7
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/05.chatMo…
dependabot[bot] Sep 8, 2025
c61af11
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/06.assist…
dependabot[bot] Sep 8, 2025
50b6505
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/04.ai.e.c…
dependabot[bot] Sep 8, 2025
4abc840
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/04.ai.f.d…
dependabot[bot] Sep 8, 2025
1a31a19
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/06.auth.o…
dependabot[bot] Sep 8, 2025
d8fb365
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/07.planne…
dependabot[bot] Sep 8, 2025
d65bd65
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/04.ai.c.a…
dependabot[bot] Sep 8, 2025
c976c60
[PY] bump: h2 from 4.1.0 to 4.3.0 in /python/samples/06.auth.oauth.me…
dependabot[bot] Sep 8, 2025
830bfd4
[C#] bump: Bump the production group with 1 update (#2583)
dependabot[bot] Sep 9, 2025
d8cf657
[PY] bump: urllib3 from 2.2.3 to 2.5.0 in /python/samples/04.ai.h.cha…
dependabot[bot] Sep 9, 2025
d968b75
[PY] bump: aiohttp from 3.10.5 to 3.12.14 in /python/samples/04.ai.h.…
dependabot[bot] Sep 9, 2025
2bdd60d
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/03.adapti…
dependabot[bot] Sep 9, 2025
2029be4
[PY] bump: rllib3 from 2.2.3 to 2.5.0 in /python/packages/ai (#2586)
dependabot[bot] Sep 9, 2025
74eca56
[PY] bump: urllib3 from 1.26.19 to 2.5.0 in /python/samples/05.chatMo…
dependabot[bot] Sep 10, 2025
614a5a7
[PY] bump: urllib3 from 1.26.19 to 2.5.0 in /python/samples/06.auth.o…
dependabot[bot] Sep 10, 2025
0b41dc9
[PY] bump: urllib3 from 1.26.19 to 2.5.0 in /python/samples/04.ai.c.a…
dependabot[bot] Sep 10, 2025
7687c5d
[PY] bump: urllib3 from 1.26.19 to 2.5.0 in /python/samples/04.ai.a.t…
dependabot[bot] Sep 10, 2025
6986a48
[PY] bump: aiohttp from 3.9.5 to 3.12.14 in /python/samples/04.ai.d.c…
dependabot[bot] Sep 10, 2025
e6e998e
[PY] bump: urllib3 from 1.26.19 to 2.5.0 in /python/samples/06.auth.o…
dependabot[bot] Sep 10, 2025
cc29cbf
[C#] bump: Bump the production group with 2 updates
dependabot[bot] Sep 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 19 additions & 24 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,8 @@ name: Coverage
on:
workflow_dispatch:
push:
branches: ['**']
paths: [
'.github/workflows/coverage.yml',
'js/**',
'dotnet/**',
'python/**'
]
branches: ["**"]
paths: [".github/workflows/coverage.yml", "js/**", "dotnet/**", "python/**"]

permissions: read-all

Expand All @@ -30,23 +25,23 @@ jobs:
dotnet: ${{ steps.filter.outputs.dotnet }}
python: ${{ steps.filter.outputs.python }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
js:
- 'js/**'
dotnet:
- 'dotnet/**'
python:
- 'python/**'
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
js:
- 'js/**'
dotnet:
- 'dotnet/**'
python:
- 'python/**'
javascript:
name: Javascript
runs-on: ubuntu-latest
environment: main
env:
node-version: 18.x
node-version: 20.x
defaults:
run:
shell: bash
Expand All @@ -59,7 +54,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup NodeJS ${{ env.node-version }}
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.node-version }}
- name: Install Dependencies
Expand Down Expand Up @@ -98,11 +93,11 @@ 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@25b1e0261a9f68d7874dbbace168300558ef68f7 # 5.4.5
uses: danielpalme/ReportGenerator-GitHub-Action@4c0f60daf67483745c34efdeadd4c4e78a19991e # 5.4.8
with:
reports: ${{ env.SOLUTION_DIR }}TestResults/*/coverage.cobertura.xml
targetdir: ${{ env.SOLUTION_DIR }}TestResults/coverage
reporttypes: 'HtmlInline;lcov'
reporttypes: "HtmlInline;lcov"
toolpath: ${{ env.SOLUTION_DIR }}report-generator-tool
- name: Coveralls
uses: coverallsapp/github-action@v2.2.3
Expand Down Expand Up @@ -133,7 +128,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python ${{ env.python-version }}
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ env.python-version }}
- name: Install Dependencies
Expand Down Expand Up @@ -161,4 +156,4 @@ jobs:
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
carryforward: 'javascript,dotnet,python'
carryforward: "javascript,dotnet,python"
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
- name: 'Checkout Repository'
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 'Dependency Review'
uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1
7 changes: 5 additions & 2 deletions .github/workflows/dotnet-build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
push:
branches: ['**']
paths: ['.github/workflows/dotnet-*.yml', 'dotnet/**']
pull_request:
branches: ['main']
paths: ['dotnet/**']

permissions: read-all

Expand Down Expand Up @@ -43,7 +46,7 @@ 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@25b1e0261a9f68d7874dbbace168300558ef68f7 # 5.4.5
uses: danielpalme/ReportGenerator-GitHub-Action@4c0f60daf67483745c34efdeadd4c4e78a19991e # 5.4.8
with:
reports: ${{ env.SOLUTION_DIR }}TestResults/*/coverage.cobertura.xml
targetdir: ${{ env.SOLUTION_DIR }}TestResults/coverage
Expand All @@ -55,6 +58,6 @@ jobs:
name: testresults-dotnet-${{ matrix.dotnet-version }}
path: ${{ env.SOLUTION_DIR }}TestResults
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Initialize CodeQL
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
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@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
category: "/language:csharp"
10 changes: 5 additions & 5 deletions .github/workflows/js-build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_call:
workflow_dispatch:
push:
branches: ['**']
paths: ['.github/workflows/js-*.yml', 'js/**']
branches: ["**"]
paths: [".github/workflows/js-*.yml", "js/**"]

permissions: read-all

Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
defaults:
run:
shell: bash
Expand All @@ -30,7 +30,7 @@ jobs:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup NodeJS ${{ matrix.node-version }}
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
Expand All @@ -42,6 +42,6 @@ jobs:
- name: Lint
run: yarn lint
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Initialize CodeQL
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
languages: javascript
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
category: "/language:javascript"
4 changes: 2 additions & 2 deletions .github/workflows/python-build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55 # v5.5.0
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
Expand All @@ -51,6 +51,6 @@ jobs:
run: |
python scripts/lint.py
- name: Harden Runner
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0
uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
with:
egress-policy: audit
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Initialize CodeQL
uses: github/codeql-action/init@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
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 @@ -36,7 +36,7 @@ jobs:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
with:
results_file: results.sarif
results_format: sarif
Expand Down 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@1b549b9259bda1cb5ddde3b41741a82a2d15a841 # v3.28.13
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
with:
sarif_file: results.sarif
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# <img src="https://media.githubusercontent.com/media/microsoft/teams-ai/main/assets/icon.png" width="100px"> Teams AI Library

> [!IMPORTANT]
> **V2 PREVIEW:** We recently released a preview of our Teams AI Library v2 in Typescript! Navigate to [branch v2-preview](https://github.com/microsoft/teams-ai/tree/v2-preview) and view our [blog post](https://devblogs.microsoft.com/microsoft365dev/announcing-the-updated-teams-ai-library-and-mcp-support/) for more information.

[![Coverage Status](https://coveralls.io/repos/github/microsoft/teams-ai/badge.svg?branch=main)](https://coveralls.io/github/microsoft/teams-ai?branch=main)

| Name | Status | Package |
Expand Down
2 changes: 0 additions & 2 deletions dotnet/packages/Microsoft.TeamsAI/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<Project>

<PropertyGroup>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>$([MSBuild]::GetPathOfFileAbove('key.snk'))</AssemblyOriginatorKeyFile>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -1967,11 +1967,13 @@ void CaptureSend(Activity[] arg)
From = new() { Id = "fromId" },
};
var turnContext1 = new TurnContext(adapter, activity1);
var messageFetchTaskResponse = new Mock<MessageFetchTaskResponse>();
var messageFetchTaskResponse = new MessageFetchTaskResponse() { Message = "response" };
var expectedInvokeResponse = new InvokeResponse()
{
Status = 200,
Body = messageFetchTaskResponse.Object
Body = new TaskModuleResponse() {
Task = new TaskModuleMessageResponse("response")
}
};
var turnState = TurnStateConfig.GetTurnStateWithConversationStateAsync(turnContext1);
var app = new Application<TurnState>(new()
Expand All @@ -1984,7 +1986,7 @@ void CaptureSend(Activity[] arg)
app.OnMessageFetchTask((turnContext, _, _, _) =>
{
names.Add(turnContext.Activity.Name);
return Task.FromResult(messageFetchTaskResponse.Object);
return Task.FromResult(messageFetchTaskResponse);
});

// Act
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,5 +300,72 @@ void CaptureSend(Activity[] arg)
// Assert
Assert.Equal("Error occurred when sending activity while streaming", ex.Message);
}

[Fact]
public async Task Test_SendTextChunk_SendsFinalMessageWithUniqueCitations()
{
// Arrange
List<Activity> activitiesToSend = [];
void CaptureSend(Activity[] arg)
{
activitiesToSend.AddRange(arg);
}
var adapter = new SimpleAdapter(CaptureSend);
ITurnContext turnContext = new TurnContext(adapter, new Activity(
text: "hello",
channelId: "channelId",
recipient: new() { Id = "recipientId" },
conversation: new() { Id = "conversationId" },
from: new() { Id = "fromId" }
));

StreamingResponse streamer = new(turnContext);

// Prepare two citations and set them on the streamer.
// Citation with [1] and citation with [2]
var citations = new List<Citation>
{
new Citation(content: "Citation 1 content", title: "Citation 1", url: "https://example.com/1"),
new Citation(content: "Citation 2 content", title: "Citation 2", url: "https://example.com/2")
};
streamer.SetCitations(citations);

// Queue text chunks where citation [1] is referenced multiple times and [2] is referenced once.
streamer.QueueTextChunk("This is a test with citation [1] and again citation [1].");
await streamer.WaitForQueue();
streamer.QueueTextChunk("Adding citation [2] and citation [1] again.");
await streamer.WaitForQueue();

// End the stream which should combine text chunks and deduplicate citations.
await streamer.EndStream();

// Assert that two updates were sent.
Assert.Equal(2, streamer.UpdatesSent());

// Assert that the citations included in the final message are unique.
// Since [1] was referenced multiple times, the final unique citation count should be 2.
Assert.NotNull(streamer.Citations);
Assert.Equal(2, streamer.Citations.Count);

// Assert that the citations are unique in the activities to send collection
activitiesToSend.ForEach(activity =>
{
if (activity.Entities != null)
{
foreach (var entity in activity.Entities)
{
if (entity is AIEntity)
{
var citations = ((AIEntity)entity).Citation;

// Assert that the citations are unique by comparing the property "position"
var uniqueCitations = citations.GroupBy(c => c.Position).Select(g => g.First()).ToList();
Assert.Equal(citations.Count, uniqueCitations.Count);
}
}
}
}) ;

}
}
}
Loading
Loading