Skip to content

Commit 398f7f6

Browse files
authored
[release/9.2] Merging internal changes (#6263)
2 parents aaa1a25 + 65564a8 commit 398f7f6

File tree

123 files changed

+4527
-939
lines changed

Some content is hidden

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

123 files changed

+4527
-939
lines changed

eng/MSBuild/ProjectStaging.props

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
-->
1212
<_IsStable Condition="('$(Stage)' != 'dev' and '$(Stage)' != 'preview') Or '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.Testing'">true</_IsStable>
1313

14-
<!--
15-
When DotNetFinalVersionKind is set to 'release' (only for the release branches),
16-
the build will produce stable outputs for 'Shipping' packages.
17-
-->
18-
<DotNetFinalVersionKind Condition=" '$(StabilizePackageVersion)' == 'true' And '$(DotNetFinalVersionKind)' == '' And '$(_IsStable)' == 'true' ">release</DotNetFinalVersionKind>
19-
2014
<!-- Preview packages: do not use stable branding and do not warn about lack of [Experimental] -->
2115
<NoWarn Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">$(NoWarn);LA0003</NoWarn>
2216
<!--

eng/Version.Details.xml

Lines changed: 94 additions & 94 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 66 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@
1111
<!--
1212
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
1313
-->
14-
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
14+
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">true</StabilizePackageVersion>
15+
16+
<!--
17+
When DotNetFinalVersionKind is set to 'release' (only for the release branches),
18+
the build will produce stable outputs for 'Shipping' packages.
19+
20+
This is used by the Arcade SDK (Publish.proj) to determine if the build is a release build or not.
21+
-->
22+
<DotNetFinalVersionKind>release</DotNetFinalVersionKind>
23+
1524
<!-- Enabling this rule will cause build failures on undocumented public APIs. -->
1625
<SkipArcadeNoWarnCS1591>true</SkipArcadeNoWarnCS1591>
1726
</PropertyGroup>
@@ -27,55 +36,55 @@
2736
-->
2837
<PropertyGroup Label="Automated Maestro dependency updates">
2938
<!-- Packages from dotnet/runtime -->
30-
<MicrosoftBclAsyncInterfacesVersion>9.0.3</MicrosoftBclAsyncInterfacesVersion>
31-
<MicrosoftBclTimeProviderVersion>9.0.3</MicrosoftBclTimeProviderVersion>
32-
<MicrosoftExtensionsCachingAbstractionsVersion>9.0.3</MicrosoftExtensionsCachingAbstractionsVersion>
33-
<MicrosoftExtensionsCachingMemoryVersion>9.0.3</MicrosoftExtensionsCachingMemoryVersion>
34-
<MicrosoftExtensionsConfigurationAbstractionsVersion>9.0.3</MicrosoftExtensionsConfigurationAbstractionsVersion>
35-
<MicrosoftExtensionsConfigurationBinderVersion>9.0.3</MicrosoftExtensionsConfigurationBinderVersion>
36-
<MicrosoftExtensionsConfigurationJsonVersion>9.0.3</MicrosoftExtensionsConfigurationJsonVersion>
37-
<MicrosoftExtensionsConfigurationVersion>9.0.3</MicrosoftExtensionsConfigurationVersion>
38-
<MicrosoftExtensionsDependencyInjectionAbstractionsVersion>9.0.3</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
39-
<MicrosoftExtensionsDependencyInjectionVersion>9.0.3</MicrosoftExtensionsDependencyInjectionVersion>
40-
<MicrosoftExtensionsDiagnosticsVersion>9.0.3</MicrosoftExtensionsDiagnosticsVersion>
41-
<MicrosoftExtensionsHostingAbstractionsVersion>9.0.3</MicrosoftExtensionsHostingAbstractionsVersion>
42-
<MicrosoftExtensionsHostingVersion>9.0.3</MicrosoftExtensionsHostingVersion>
43-
<MicrosoftExtensionsHttpVersion>9.0.3</MicrosoftExtensionsHttpVersion>
44-
<MicrosoftExtensionsLoggingAbstractionsVersion>9.0.3</MicrosoftExtensionsLoggingAbstractionsVersion>
45-
<MicrosoftExtensionsLoggingConfigurationVersion>9.0.3</MicrosoftExtensionsLoggingConfigurationVersion>
46-
<MicrosoftExtensionsLoggingConsoleVersion>9.0.3</MicrosoftExtensionsLoggingConsoleVersion>
47-
<MicrosoftExtensionsLoggingVersion>9.0.3</MicrosoftExtensionsLoggingVersion>
48-
<MicrosoftExtensionsOptionsConfigurationExtensionsVersion>9.0.3</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
49-
<MicrosoftExtensionsOptionsVersion>9.0.3</MicrosoftExtensionsOptionsVersion>
50-
<MicrosoftNETCoreAppRefVersion>9.0.3</MicrosoftNETCoreAppRefVersion>
51-
<MicrosoftNETCoreAppRuntimewinx64Version>9.0.3</MicrosoftNETCoreAppRuntimewinx64Version>
52-
<SystemCollectionsImmutableVersion>9.0.3</SystemCollectionsImmutableVersion>
53-
<SystemConfigurationConfigurationManagerVersion>9.0.3</SystemConfigurationConfigurationManagerVersion>
54-
<SystemDiagnosticsDiagnosticSourceVersion>9.0.3</SystemDiagnosticsDiagnosticSourceVersion>
55-
<SystemDiagnosticsPerformanceCounterVersion>9.0.3</SystemDiagnosticsPerformanceCounterVersion>
56-
<SystemIOHashingVersion>9.0.3</SystemIOHashingVersion>
57-
<SystemIOPipelinesVersion>9.0.3</SystemIOPipelinesVersion>
58-
<SystemMemoryDataVersion>9.0.3</SystemMemoryDataVersion>
59-
<SystemNetHttpJsonVersion>9.0.3</SystemNetHttpJsonVersion>
60-
<SystemRuntimeCachingVersion>9.0.3</SystemRuntimeCachingVersion>
61-
<SystemSecurityCryptographyPkcsVersion>9.0.3</SystemSecurityCryptographyPkcsVersion>
62-
<SystemSecurityCryptographyXmlVersion>9.0.3</SystemSecurityCryptographyXmlVersion>
63-
<SystemTextEncodingsWebVersion>9.0.3</SystemTextEncodingsWebVersion>
64-
<SystemNumericsTensorsVersion>9.0.3</SystemNumericsTensorsVersion>
65-
<SystemTextJsonVersion>9.0.3</SystemTextJsonVersion>
66-
<SystemThreadingChannelsVersion>9.0.3</SystemThreadingChannelsVersion>
39+
<MicrosoftBclAsyncInterfacesVersion>9.0.4</MicrosoftBclAsyncInterfacesVersion>
40+
<MicrosoftBclTimeProviderVersion>9.0.4</MicrosoftBclTimeProviderVersion>
41+
<MicrosoftExtensionsCachingAbstractionsVersion>9.0.4</MicrosoftExtensionsCachingAbstractionsVersion>
42+
<MicrosoftExtensionsCachingMemoryVersion>9.0.4</MicrosoftExtensionsCachingMemoryVersion>
43+
<MicrosoftExtensionsConfigurationAbstractionsVersion>9.0.4</MicrosoftExtensionsConfigurationAbstractionsVersion>
44+
<MicrosoftExtensionsConfigurationBinderVersion>9.0.4</MicrosoftExtensionsConfigurationBinderVersion>
45+
<MicrosoftExtensionsConfigurationJsonVersion>9.0.4</MicrosoftExtensionsConfigurationJsonVersion>
46+
<MicrosoftExtensionsConfigurationVersion>9.0.4</MicrosoftExtensionsConfigurationVersion>
47+
<MicrosoftExtensionsDependencyInjectionAbstractionsVersion>9.0.4</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
48+
<MicrosoftExtensionsDependencyInjectionVersion>9.0.4</MicrosoftExtensionsDependencyInjectionVersion>
49+
<MicrosoftExtensionsDiagnosticsVersion>9.0.4</MicrosoftExtensionsDiagnosticsVersion>
50+
<MicrosoftExtensionsHostingAbstractionsVersion>9.0.4</MicrosoftExtensionsHostingAbstractionsVersion>
51+
<MicrosoftExtensionsHostingVersion>9.0.4</MicrosoftExtensionsHostingVersion>
52+
<MicrosoftExtensionsHttpVersion>9.0.4</MicrosoftExtensionsHttpVersion>
53+
<MicrosoftExtensionsLoggingAbstractionsVersion>9.0.4</MicrosoftExtensionsLoggingAbstractionsVersion>
54+
<MicrosoftExtensionsLoggingConfigurationVersion>9.0.4</MicrosoftExtensionsLoggingConfigurationVersion>
55+
<MicrosoftExtensionsLoggingConsoleVersion>9.0.4</MicrosoftExtensionsLoggingConsoleVersion>
56+
<MicrosoftExtensionsLoggingVersion>9.0.4</MicrosoftExtensionsLoggingVersion>
57+
<MicrosoftExtensionsOptionsConfigurationExtensionsVersion>9.0.4</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
58+
<MicrosoftExtensionsOptionsVersion>9.0.4</MicrosoftExtensionsOptionsVersion>
59+
<MicrosoftNETCoreAppRefVersion>9.0.4</MicrosoftNETCoreAppRefVersion>
60+
<MicrosoftNETCoreAppRuntimewinx64Version>9.0.4</MicrosoftNETCoreAppRuntimewinx64Version>
61+
<SystemCollectionsImmutableVersion>9.0.4</SystemCollectionsImmutableVersion>
62+
<SystemConfigurationConfigurationManagerVersion>9.0.4</SystemConfigurationConfigurationManagerVersion>
63+
<SystemDiagnosticsDiagnosticSourceVersion>9.0.4</SystemDiagnosticsDiagnosticSourceVersion>
64+
<SystemDiagnosticsPerformanceCounterVersion>9.0.4</SystemDiagnosticsPerformanceCounterVersion>
65+
<SystemIOHashingVersion>9.0.4</SystemIOHashingVersion>
66+
<SystemIOPipelinesVersion>9.0.4</SystemIOPipelinesVersion>
67+
<SystemMemoryDataVersion>9.0.4</SystemMemoryDataVersion>
68+
<SystemNetHttpJsonVersion>9.0.4</SystemNetHttpJsonVersion>
69+
<SystemRuntimeCachingVersion>9.0.4</SystemRuntimeCachingVersion>
70+
<SystemSecurityCryptographyPkcsVersion>9.0.4</SystemSecurityCryptographyPkcsVersion>
71+
<SystemSecurityCryptographyXmlVersion>9.0.4</SystemSecurityCryptographyXmlVersion>
72+
<SystemTextEncodingsWebVersion>9.0.4</SystemTextEncodingsWebVersion>
73+
<SystemNumericsTensorsVersion>9.0.4</SystemNumericsTensorsVersion>
74+
<SystemTextJsonVersion>9.0.4</SystemTextJsonVersion>
75+
<SystemThreadingChannelsVersion>9.0.4</SystemThreadingChannelsVersion>
6776
<!-- Dependencies from https://github.com/aspnet/AspNetCore -->
68-
<MicrosoftAspNetCoreAppRefVersion>9.0.3</MicrosoftAspNetCoreAppRefVersion>
69-
<MicrosoftAspNetCoreAppRuntimewinx64Version>9.0.3</MicrosoftAspNetCoreAppRuntimewinx64Version>
70-
<MicrosoftAspNetCoreMvcTestingVersion>9.0.3</MicrosoftAspNetCoreMvcTestingVersion>
71-
<MicrosoftAspNetCoreTestHostVersion>9.0.3</MicrosoftAspNetCoreTestHostVersion>
72-
<MicrosoftExtensionsCachingSqlServerVersion>9.0.3</MicrosoftExtensionsCachingSqlServerVersion>
73-
<MicrosoftExtensionsCachingStackExchangeRedisVersion>9.0.3</MicrosoftExtensionsCachingStackExchangeRedisVersion>
74-
<MicrosoftExtensionsDiagnosticsHealthChecksVersion>9.0.3</MicrosoftExtensionsDiagnosticsHealthChecksVersion>
75-
<MicrosoftExtensionsHttpPollyVersion>9.0.3</MicrosoftExtensionsHttpPollyVersion>
76-
<MicrosoftExtensionsObjectPoolVersion>9.0.3</MicrosoftExtensionsObjectPoolVersion>
77+
<MicrosoftAspNetCoreAppRefVersion>9.0.4</MicrosoftAspNetCoreAppRefVersion>
78+
<MicrosoftAspNetCoreAppRuntimewinx64Version>9.0.4</MicrosoftAspNetCoreAppRuntimewinx64Version>
79+
<MicrosoftAspNetCoreMvcTestingVersion>9.0.4</MicrosoftAspNetCoreMvcTestingVersion>
80+
<MicrosoftAspNetCoreTestHostVersion>9.0.4</MicrosoftAspNetCoreTestHostVersion>
81+
<MicrosoftExtensionsCachingSqlServerVersion>9.0.4</MicrosoftExtensionsCachingSqlServerVersion>
82+
<MicrosoftExtensionsCachingStackExchangeRedisVersion>9.0.4</MicrosoftExtensionsCachingStackExchangeRedisVersion>
83+
<MicrosoftExtensionsDiagnosticsHealthChecksVersion>9.0.4</MicrosoftExtensionsDiagnosticsHealthChecksVersion>
84+
<MicrosoftExtensionsHttpPollyVersion>9.0.4</MicrosoftExtensionsHttpPollyVersion>
85+
<MicrosoftExtensionsObjectPoolVersion>9.0.4</MicrosoftExtensionsObjectPoolVersion>
7786
<!-- Dependencies from https://github.com/dotnet/efcore -->
78-
<MicrosoftEntityFrameworkCoreSqliteVersion>9.0.3</MicrosoftEntityFrameworkCoreSqliteVersion>
87+
<MicrosoftEntityFrameworkCoreSqliteVersion>9.0.4</MicrosoftEntityFrameworkCoreSqliteVersion>
7988
<!-- Dependencies from https://github.com/dotnet/arcade -->
8089
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25164.2</MicrosoftDotNetBuildTasksTemplatingVersion>
8190
</PropertyGroup>
@@ -119,15 +128,15 @@
119128
<SystemTextJsonLTSVersion>8.0.5</SystemTextJsonLTSVersion>
120129
<SystemThreadingChannelsLTSVersion>8.0.0</SystemThreadingChannelsLTSVersion>
121130
<!-- Dependencies from https://github.com/aspnet/AspNetCore -->
122-
<MicrosoftAspNetCoreAppRefLTSVersion>8.0.14</MicrosoftAspNetCoreAppRefLTSVersion>
123-
<MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>8.0.14</MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>
124-
<MicrosoftAspNetCoreMvcTestingLTSVersion>8.0.14</MicrosoftAspNetCoreMvcTestingLTSVersion>
125-
<MicrosoftAspNetCoreTestHostLTSVersion>8.0.14</MicrosoftAspNetCoreTestHostLTSVersion>
126-
<MicrosoftExtensionsCachingSqlServerLTSVersion>8.0.14</MicrosoftExtensionsCachingSqlServerLTSVersion>
127-
<MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>8.0.14</MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>
128-
<MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>8.0.14</MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>
129-
<MicrosoftExtensionsHttpPollyLTSVersion>8.0.14</MicrosoftExtensionsHttpPollyLTSVersion>
130-
<MicrosoftExtensionsObjectPoolLTSVersion>8.0.14</MicrosoftExtensionsObjectPoolLTSVersion>
131+
<MicrosoftAspNetCoreAppRefLTSVersion>8.0.15</MicrosoftAspNetCoreAppRefLTSVersion>
132+
<MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>8.0.15</MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>
133+
<MicrosoftAspNetCoreMvcTestingLTSVersion>8.0.15</MicrosoftAspNetCoreMvcTestingLTSVersion>
134+
<MicrosoftAspNetCoreTestHostLTSVersion>8.0.15</MicrosoftAspNetCoreTestHostLTSVersion>
135+
<MicrosoftExtensionsCachingSqlServerLTSVersion>8.0.15</MicrosoftExtensionsCachingSqlServerLTSVersion>
136+
<MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>8.0.15</MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>
137+
<MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>8.0.15</MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>
138+
<MicrosoftExtensionsHttpPollyLTSVersion>8.0.15</MicrosoftExtensionsHttpPollyLTSVersion>
139+
<MicrosoftExtensionsObjectPoolLTSVersion>8.0.15</MicrosoftExtensionsObjectPoolLTSVersion>
131140
</PropertyGroup>
132141
<!--
133142

eng/packages/General.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<ItemGroup>
4+
<PackageVersion Include="Azure.Core" Version="1.45.0" />
45
<PackageVersion Include="Azure.Identity" Version="1.13.2" />
56
<PackageVersion Include="Azure.Storage.Files.DataLake" Version="12.21.0" />
67
<PackageVersion Include="Azure.AI.Inference" Version="1.0.0-beta.4" />

src/Libraries/Microsoft.Extensions.AI.Abstractions/ChatCompletion/ChatResponseExtensions.cs

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -180,53 +180,60 @@ static async Task<ChatResponse> ToChatResponseAsync(
180180
}
181181
}
182182

183-
/// <summary>Coalesces sequential <see cref="TextContent"/> content elements.</summary>
183+
/// <summary>Coalesces sequential <see cref="AIContent"/> content elements.</summary>
184184
internal static void CoalesceTextContent(List<AIContent> contents)
185185
{
186-
StringBuilder? coalescedText = null;
186+
Coalesce<TextContent>(contents, static text => new(text));
187+
Coalesce<TextReasoningContent>(contents, static text => new(text));
187188

188-
// Iterate through all of the items in the list looking for contiguous items that can be coalesced.
189-
int start = 0;
190-
while (start < contents.Count - 1)
189+
// This implementation relies on TContent's ToString returning its exact text.
190+
static void Coalesce<TContent>(List<AIContent> contents, Func<string, TContent> fromText)
191+
where TContent : AIContent
191192
{
192-
// We need at least two TextContents in a row to be able to coalesce.
193-
if (contents[start] is not TextContent firstText)
194-
{
195-
start++;
196-
continue;
197-
}
198-
199-
if (contents[start + 1] is not TextContent secondText)
200-
{
201-
start += 2;
202-
continue;
203-
}
193+
StringBuilder? coalescedText = null;
204194

205-
// Append the text from those nodes and continue appending subsequent TextContents until we run out.
206-
// We null out nodes as their text is appended so that we can later remove them all in one O(N) operation.
207-
coalescedText ??= new();
208-
_ = coalescedText.Clear().Append(firstText.Text).Append(secondText.Text);
209-
contents[start + 1] = null!;
210-
int i = start + 2;
211-
for (; i < contents.Count && contents[i] is TextContent next; i++)
195+
// Iterate through all of the items in the list looking for contiguous items that can be coalesced.
196+
int start = 0;
197+
while (start < contents.Count - 1)
212198
{
213-
_ = coalescedText.Append(next.Text);
214-
contents[i] = null!;
199+
// We need at least two TextContents in a row to be able to coalesce.
200+
if (contents[start] is not TContent firstText)
201+
{
202+
start++;
203+
continue;
204+
}
205+
206+
if (contents[start + 1] is not TContent secondText)
207+
{
208+
start += 2;
209+
continue;
210+
}
211+
212+
// Append the text from those nodes and continue appending subsequent TextContents until we run out.
213+
// We null out nodes as their text is appended so that we can later remove them all in one O(N) operation.
214+
coalescedText ??= new();
215+
_ = coalescedText.Clear().Append(firstText).Append(secondText);
216+
contents[start + 1] = null!;
217+
int i = start + 2;
218+
for (; i < contents.Count && contents[i] is TContent next; i++)
219+
{
220+
_ = coalescedText.Append(next);
221+
contents[i] = null!;
222+
}
223+
224+
// Store the replacement node. We inherit the properties of the first text node. We don't
225+
// currently propagate additional properties from the subsequent nodes. If we ever need to,
226+
// we can add that here.
227+
var newContent = fromText(coalescedText.ToString());
228+
contents[start] = newContent;
229+
newContent.AdditionalProperties = firstText.AdditionalProperties?.Clone();
230+
231+
start = i;
215232
}
216233

217-
// Store the replacement node.
218-
contents[start] = new TextContent(coalescedText.ToString())
219-
{
220-
// We inherit the properties of the first text node. We don't currently propagate additional
221-
// properties from the subsequent nodes. If we ever need to, we can add that here.
222-
AdditionalProperties = firstText.AdditionalProperties?.Clone(),
223-
};
224-
225-
start = i;
234+
// Remove all of the null slots left over from the coalescing process.
235+
_ = contents.RemoveAll(u => u is null);
226236
}
227-
228-
// Remove all of the null slots left over from the coalescing process.
229-
_ = contents.RemoveAll(u => u is null);
230237
}
231238

232239
/// <summary>Finalizes the <paramref name="response"/> object.</summary>

src/Libraries/Microsoft.Extensions.AI.Abstractions/Contents/AIContent.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace Microsoft.Extensions.AI;
1212
[JsonDerivedType(typeof(FunctionCallContent), typeDiscriminator: "functionCall")]
1313
[JsonDerivedType(typeof(FunctionResultContent), typeDiscriminator: "functionResult")]
1414
[JsonDerivedType(typeof(TextContent), typeDiscriminator: "text")]
15+
[JsonDerivedType(typeof(TextReasoningContent), typeDiscriminator: "reasoning")]
1516
[JsonDerivedType(typeof(UriContent), typeDiscriminator: "uri")]
1617
[JsonDerivedType(typeof(UsageContent), typeDiscriminator: "usage")]
1718
public class AIContent

0 commit comments

Comments
 (0)