Skip to content

Commit 8929016

Browse files
Merge branch 'main' into mbuck/simplify-chat-streaming
2 parents 0ca5bda + 824ff6e commit 8929016

File tree

43 files changed

+2456
-1185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2456
-1185
lines changed

.github/workflows/backport.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ permissions:
1515
jobs:
1616
backport:
1717
if: ${{ contains(github.event.comment.body, '/backport to') || github.event_name == 'schedule' }}
18-
uses: dotnet/arcade/.github/workflows/backport-base.yml@main
18+
uses: dotnet/arcade/.github/workflows/backport-base.yml@1912d9f4fc410d421a01b5a09131aae234b603fa # main
1919
with:
2020
pr_description_template: |
2121
Backport of #%source_pr_number% to %target_branch%

.github/workflows/inter-branch-merge-flow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ permissions:
1111

1212
jobs:
1313
Merge:
14-
uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
14+
uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@1912d9f4fc410d421a01b5a09131aae234b603fa # main

.github/workflows/locker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
if: ${{ github.repository_owner == 'dotnet' }}
2424
steps:
2525
- name: Checkout Actions
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2727
with:
2828
repository: "microsoft/vscode-github-triage-actions"
2929
path: ./actions

.github/workflows/update-sdk.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
name: Update .NET SDK
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
2323
with:
2424
ref: dev
2525
- uses: martincostello/update-dotnet-sdk@76e2c0df2303d4f6a404228105ebb7d60ace0556 # v3.4.0

NuGet.config

-14
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@
44
<clear />
55
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
66
<!-- Begin: Package sources from dotnet-aspnetcore -->
7-
<add key="darc-int-dotnet-aspnetcore-b96167f-2" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-aspnetcore-b96167fb-2/nuget/v3/index.json" />
87
<!-- End: Package sources from dotnet-aspnetcore -->
98
<!-- Begin: Package sources from dotnet-efcore -->
10-
<add key="darc-int-dotnet-efcore-68c7e19" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-68c7e194/nuget/v3/index.json" />
11-
<add key="darc-int-dotnet-efcore-68c7e19-2" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-68c7e194-2/nuget/v3/index.json" />
12-
<add key="darc-int-dotnet-efcore-68c7e19-1" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-efcore-68c7e194-1/nuget/v3/index.json" />
139
<!-- End: Package sources from dotnet-efcore -->
1410
<!-- Begin: Package sources from dotnet-runtime -->
15-
<add key="darc-int-dotnet-runtime-831d23e" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-831d23e5/nuget/v3/index.json" />
16-
<add key="darc-int-dotnet-runtime-831d23e-2" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-831d23e5-2/nuget/v3/index.json" />
17-
<add key="darc-int-dotnet-runtime-831d23e-1" value="https://pkgs.dev.azure.com/dnceng/internal/_packaging/darc-int-dotnet-runtime-831d23e5-1/nuget/v3/index.json" />
1811
<!-- End: Package sources from dotnet-runtime -->
1912
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
2013
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
@@ -50,17 +43,10 @@
5043
<disabledPackageSources>
5144
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
5245
<!-- Begin: Package sources from dotnet-aspnetcore -->
53-
<add key="darc-int-dotnet-aspnetcore-b96167f-2" value="true" />
5446
<!-- Begin: Package sources from dotnet-efcore -->
55-
<add key="darc-int-dotnet-efcore-68c7e19-1" value="true" />
56-
<add key="darc-int-dotnet-efcore-68c7e19-2" value="true" />
57-
<add key="darc-int-dotnet-efcore-68c7e19" value="true" />
5847
<!-- End: Package sources from dotnet-efcore -->
5948
<!-- End: Package sources from dotnet-aspnetcore -->
6049
<!-- Begin: Package sources from dotnet-runtime -->
61-
<add key="darc-int-dotnet-runtime-831d23e-1" value="true" />
62-
<add key="darc-int-dotnet-runtime-831d23e-2" value="true" />
63-
<add key="darc-int-dotnet-runtime-831d23e" value="true" />
6450
<!-- End: Package sources from dotnet-runtime -->
6551
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
6652
</disabledPackageSources>

eng/Version.Details.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,17 @@
194194
</Dependency>
195195
</ProductDependencies>
196196
<ToolsetDependencies>
197-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25161.4">
197+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25164.2">
198198
<Uri>https://github.com/dotnet/arcade</Uri>
199-
<Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha>
199+
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
200200
</Dependency>
201-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25161.4">
201+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25164.2">
202202
<Uri>https://github.com/dotnet/arcade</Uri>
203-
<Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha>
203+
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
204204
</Dependency>
205-
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.25161.4">
205+
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.25164.2">
206206
<Uri>https://github.com/dotnet/arcade</Uri>
207-
<Sha>f33d9e642f0e68a61312164cd9e0baf4e142a999</Sha>
207+
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
208208
</Dependency>
209209
</ToolsetDependencies>
210210
</Dependencies>

eng/Versions.props

+1-3
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<!-- Dependencies from https://github.com/dotnet/efcore -->
7878
<MicrosoftEntityFrameworkCoreSqliteVersion>9.0.3</MicrosoftEntityFrameworkCoreSqliteVersion>
7979
<!-- Dependencies from https://github.com/dotnet/arcade -->
80-
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25161.4</MicrosoftDotNetBuildTasksTemplatingVersion>
80+
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25164.2</MicrosoftDotNetBuildTasksTemplatingVersion>
8181
</PropertyGroup>
8282
<PropertyGroup Label="No longer automated Maestro dependency updates">
8383
<!-- Packages from dotnet/runtime -->
@@ -146,7 +146,6 @@
146146
<!-- Compatibility with VS 17.8/.NET SDK 8.0.1xx -->
147147
<MicrosoftCodeAnalysisVersion>4.8.0</MicrosoftCodeAnalysisVersion>
148148
<MicrosoftCodeAnalysisAnalyzersVersion>3.3.4</MicrosoftCodeAnalysisAnalyzersVersion>
149-
150149
<!-- AI templates -->
151150
<AzureAIProjectsVersion>1.0.0-beta.3</AzureAIProjectsVersion>
152151
<AzureAIOpenAIVersion>2.2.0-beta.1</AzureAIOpenAIVersion>
@@ -158,7 +157,6 @@
158157
<OpenAIVersion>2.2.0-beta.1</OpenAIVersion>
159158
<PdfPigVersion>0.1.9</PdfPigVersion>
160159
<SystemLinqAsyncVersion>6.0.1</SystemLinqAsyncVersion>
161-
162160
<!--
163161
xUnit version is configured by the Arcade SDK.
164162
https://github.com/dotnet/arcade/blob/f5a7c5d5c56197b09715dece7541ca06beb94eb0/src/Microsoft.DotNet.Arcade.Sdk/tools/XUnit/XUnit.targets#L9

eng/common/tools.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
[bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true }
4343

4444
# Enable repos to use a particular version of the on-line dotnet-install scripts.
45-
# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.ps1
45+
# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.ps1
4646
[string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { 'v1' }
4747

4848
# True to use global NuGet cache instead of restoring packages to repository-local directory.
@@ -262,7 +262,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
262262
if (!(Test-Path $installScript)) {
263263
Create-Directory $dotnetRoot
264264
$ProgressPreference = 'SilentlyContinue' # Don't display the console progress UI - it's a huge perf hit
265-
$uri = "https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1"
265+
$uri = "https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.ps1"
266266

267267
Retry({
268268
Write-Host "GET $uri"

eng/common/tools.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ warn_as_error=${warn_as_error:-true}
5454
use_installed_dotnet_cli=${use_installed_dotnet_cli:-true}
5555

5656
# Enable repos to use a particular version of the on-line dotnet-install scripts.
57-
# default URL: https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
57+
# default URL: https://builds.dotnet.microsoft.com/dotnet/scripts/v1/dotnet-install.sh
5858
dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'}
5959

6060
# True to use global NuGet cache instead of restoring packages to repository-local directory.
@@ -295,7 +295,7 @@ function with_retries {
295295
function GetDotNetInstallScript {
296296
local root=$1
297297
local install_script="$root/dotnet-install.sh"
298-
local install_script_url="https://dotnet.microsoft.com/download/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh"
298+
local install_script_url="https://builds.dotnet.microsoft.com/dotnet/scripts/$dotnetInstallScriptVersion/dotnet-install.sh"
299299

300300
if [[ ! -a "$install_script" ]]; then
301301
mkdir -p "$root"

eng/packages/General.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
1414
<PackageVersion Include="Microsoft.ML.Tokenizers" Version="$(MicrosoftMLTokenizersVersion)" />
1515
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
16-
<PackageVersion Include="OpenAI" Version="2.2.0-beta.1" />
16+
<PackageVersion Include="OpenAI" Version="2.2.0-beta.3" />
1717
<PackageVersion Include="Polly" Version="8.4.2" />
1818
<PackageVersion Include="Polly.Core" Version="8.4.2" />
1919
<PackageVersion Include="Polly.Extensions" Version="8.4.2" />

eng/packages/TestOnly.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
44
<PackageVersion Include="AutoFixture.AutoMoq" Version="4.17.0" />
5-
<PackageVersion Include="Azure.AI.OpenAI" Version="2.2.0-beta.1" />
5+
<PackageVersion Include="Azure.AI.OpenAI" Version="2.2.0-beta.2" />
66
<PackageVersion Include="Azure.Identity" Version="1.13.2" />
77
<PackageVersion Include="autofixture" Version="4.17.0" />
88
<PackageVersion Include="BenchmarkDotNet" Version="0.13.5" />

eng/pipelines/templates/BuildAndTest.yml

+42
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,48 @@ steps:
5858
"${{ parameters.buildScript }} -test -configuration ${{ parameters.buildConfig }} /bl:${{ parameters.repoLogPath }}/tests.binlog $(_OfficialBuildIdArgs)"
5959
displayName: Run tests
6060

61+
- pwsh: |
62+
$SourcesDirectory = '$(Build.SourcesDirectory)';
63+
64+
$destinationPath = "${{ parameters.repoLogPath }}/FailedAssertions"
65+
if (-not (Test-Path -Path $destinationPath)) {
66+
New-Item -Path $destinationPath -ItemType Directory -Force | Out-Null
67+
}
68+
69+
Get-ChildItem $SourcesDirectory -Filter "*.received.*" -Recurse | `
70+
ForEach-Object {
71+
# Exclude files that are already in the test results path
72+
if ($_.FullName -like "*FailedAssertions*") {
73+
return
74+
}
75+
76+
if ($_.PSIsContainer) {
77+
# Delete the folder if it exists
78+
$dest = Join-Path -Path $destinationPath -ChildPath $_.Name
79+
if (Test-Path -Path $dest) {
80+
Remove-Item -Path $dest -Recurse -Force
81+
}
82+
# Copy folder to logs
83+
Copy-Item -Path $_.FullName -Destination $destinationPath -Recurse -Force
84+
}
85+
else {
86+
# Calculates the relative path of the file with respect to `$SourcesDirectory`.
87+
$relativePath = [System.IO.Path]::GetRelativePath($SourcesDirectory, $_.FullName)
88+
# Constructs the full destination path for the file, preserving the relative directory structure.
89+
$destinationFile = Join-Path -Path $destinationPath -ChildPath $relativePath
90+
$destinationDirectory = [System.IO.Path]::GetDirectoryName($destinationFile)
91+
# Ensures the destination directory exists (creates it if necessary).
92+
if (-not (Test-Path -Path $destinationDirectory)) {
93+
New-Item -Path $destinationDirectory -ItemType Directory -Force | Out-Null
94+
}
95+
# Copies the file to the destination path.
96+
Copy-Item -Path $_.FullName -Destination $destinationFile -Force
97+
}
98+
}
99+
displayName: Copy failed assertions results to logs
100+
condition: always()
101+
continueOnError: true
102+
61103
- pwsh: |
62104
Get-ChildItem ${{ parameters.repoTestResultsPath }} -Include "*_hangdump.dmp","Sequence_*.xml" -Recurse | `
63105
ForEach-Object {

global.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"msbuild-sdks": {
1919
"Microsoft.Build.NoTargets": "3.7.0",
2020
"Microsoft.Build.Traversal": "3.2.0",
21-
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25161.4",
22-
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25161.4"
21+
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25164.2",
22+
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25164.2"
2323
}
2424
}

src/Libraries/Microsoft.Extensions.AI.Abstractions/CHANGELOG.md

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Release History
22

3+
## 9.3.0-preview.1.25161.3
4+
5+
- Changed `IChatClient.GetResponseAsync` and `IChatClient.GetStreamingResponseAsync` to accept an `IEnumerable<ChatMessage>` rather than an `IList<ChatMessage>`. It is no longer mutated by implementations.
6+
- Removed `ChatResponse.Choice` and `ChatResponseUpdate.ChoiceIndex`.
7+
- Replaced `ChatResponse.Message` with `ChatResponse.Messages`. Responses now carry with them all messages generated as part of the operation, rather than all but the last being added to the history and the last returned.
8+
- Added `GetRequiredService` extension method for `IChatClient`/`IEmbeddingGenerator`.
9+
- Added non-generic `IEmbeddingGenerator` interface, which is inherited by `IEmbeddingGenerator<TInput, TEmbedding>`. The `GetService` method moves down to the non-generic interface, and the `GetService`/`GetRequiredService` extension methods are now in terms of the non-generic.
10+
- `AIJsonUtilities.CreateFunctionJsonSchema` now special-cases `CancellationToken` to not include it in the schema.
11+
- Improved the debugger displays for `ChatMessage` and the `AIContent` types.
12+
- Added a static `AIJsonUtilities.HashDataToString` method.
13+
- Split `DataContent`, which handled both in-memory data and URIs to remote data, into `DataContent` (for the former) and `UriContent` (for the latter).
14+
- Renamed `DataContent.MediaTypeStartsWith` to `DataContent.HasTopLevelMediaType`, and changed semantics accordingly.
15+
316
## 9.3.0-preview.1.25114.11
417

518
- Renamed `IChatClient.Complete{Streaming}Async` to `IChatClient.Get{Streaming}ResponseAsync`. This is to avoid confusion with "Complete" being about stopping an operation, as well as to avoid tying the methods to a particular implementation detail of how responses are generated. Along with this, renamed `ChatCompletion` to `ChatResponse`, `StreamingChatCompletionUpdate` to `ChatResponseUpdate`, `CompletionId` to `ResponseId`, `ToStreamingChatCompletionUpdates` to `ToChatResponseUpdates`, and `ToChatCompletion{Async}` to `ToChatResponse{Async}`.

src/Libraries/Microsoft.Extensions.AI.Abstractions/CodeInterpreterTool.cs

-17
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
namespace Microsoft.Extensions.AI;
5+
6+
/// <summary>Represents a hosted tool that can be specified to an AI service to enable it to execute code it generates.</summary>
7+
/// <remarks>
8+
/// This tool does not itself implement code interpretation. It is a marker that can be used to inform a service
9+
/// that the service is allowed to execute its generated code if the service is capable of doing so.
10+
/// </remarks>
11+
public class HostedCodeInterpreterTool : AITool
12+
{
13+
/// <summary>Initializes a new instance of the <see cref="HostedCodeInterpreterTool"/> class.</summary>
14+
public HostedCodeInterpreterTool()
15+
{
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
namespace Microsoft.Extensions.AI;
5+
6+
/// <summary>Represents a hosted tool that can be specified to an AI service to enable it to perform web searches.</summary>
7+
/// <remarks>
8+
/// This tool does not itself implement web searches. It is a marker that can be used to inform a service
9+
/// that the service is allowed to perform web searches if the service is capable of doing so.
10+
/// </remarks>
11+
public class HostedWebSearchTool : AITool
12+
{
13+
/// <summary>Initializes a new instance of the <see cref="HostedWebSearchTool"/> class.</summary>
14+
public HostedWebSearchTool()
15+
{
16+
}
17+
}

0 commit comments

Comments
 (0)