Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
6 changes: 0 additions & 6 deletions eng/MSBuild/ProjectStaging.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@
-->
<_IsStable Condition="('$(Stage)' != 'dev' and '$(Stage)' != 'preview') Or '$(MSBuildProjectName)' == 'Microsoft.AspNetCore.Testing'">true</_IsStable>

<!--
When DotNetFinalVersionKind is set to 'release' (only for the release branches),
the build will produce stable outputs for 'Shipping' packages.
-->
<DotNetFinalVersionKind Condition=" '$(StabilizePackageVersion)' == 'true' And '$(DotNetFinalVersionKind)' == '' And '$(_IsStable)' == 'true' ">release</DotNetFinalVersionKind>

<!-- Preview packages: do not use stable branding and do not warn about lack of [Experimental] -->
<NoWarn Condition="'$(Stage)' == 'dev' or '$(Stage)' == 'preview'">$(NoWarn);LA0003</NoWarn>
<!--
Expand Down
188 changes: 94 additions & 94 deletions eng/Version.Details.xml

Large diffs are not rendered by default.

123 changes: 66 additions & 57 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,16 @@
<!--
When StabilizePackageVersion is set to 'true', this branch will produce stable outputs for 'Shipping' packages
-->
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">true</StabilizePackageVersion>

<!--
When DotNetFinalVersionKind is set to 'release' (only for the release branches),
the build will produce stable outputs for 'Shipping' packages.

This is used by the Arcade SDK (Publish.proj) to determine if the build is a release build or not.
-->
<DotNetFinalVersionKind>release</DotNetFinalVersionKind>

<!-- Enabling this rule will cause build failures on undocumented public APIs. -->
<SkipArcadeNoWarnCS1591>true</SkipArcadeNoWarnCS1591>
</PropertyGroup>
Expand All @@ -27,55 +36,55 @@
-->
<PropertyGroup Label="Automated Maestro dependency updates">
<!-- Packages from dotnet/runtime -->
<MicrosoftBclAsyncInterfacesVersion>9.0.3</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclTimeProviderVersion>9.0.3</MicrosoftBclTimeProviderVersion>
<MicrosoftExtensionsCachingAbstractionsVersion>9.0.3</MicrosoftExtensionsCachingAbstractionsVersion>
<MicrosoftExtensionsCachingMemoryVersion>9.0.3</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsConfigurationAbstractionsVersion>9.0.3</MicrosoftExtensionsConfigurationAbstractionsVersion>
<MicrosoftExtensionsConfigurationBinderVersion>9.0.3</MicrosoftExtensionsConfigurationBinderVersion>
<MicrosoftExtensionsConfigurationJsonVersion>9.0.3</MicrosoftExtensionsConfigurationJsonVersion>
<MicrosoftExtensionsConfigurationVersion>9.0.3</MicrosoftExtensionsConfigurationVersion>
<MicrosoftExtensionsDependencyInjectionAbstractionsVersion>9.0.3</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
<MicrosoftExtensionsDependencyInjectionVersion>9.0.3</MicrosoftExtensionsDependencyInjectionVersion>
<MicrosoftExtensionsDiagnosticsVersion>9.0.3</MicrosoftExtensionsDiagnosticsVersion>
<MicrosoftExtensionsHostingAbstractionsVersion>9.0.3</MicrosoftExtensionsHostingAbstractionsVersion>
<MicrosoftExtensionsHostingVersion>9.0.3</MicrosoftExtensionsHostingVersion>
<MicrosoftExtensionsHttpVersion>9.0.3</MicrosoftExtensionsHttpVersion>
<MicrosoftExtensionsLoggingAbstractionsVersion>9.0.3</MicrosoftExtensionsLoggingAbstractionsVersion>
<MicrosoftExtensionsLoggingConfigurationVersion>9.0.3</MicrosoftExtensionsLoggingConfigurationVersion>
<MicrosoftExtensionsLoggingConsoleVersion>9.0.3</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftExtensionsLoggingVersion>9.0.3</MicrosoftExtensionsLoggingVersion>
<MicrosoftExtensionsOptionsConfigurationExtensionsVersion>9.0.3</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
<MicrosoftExtensionsOptionsVersion>9.0.3</MicrosoftExtensionsOptionsVersion>
<MicrosoftNETCoreAppRefVersion>9.0.3</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>9.0.3</MicrosoftNETCoreAppRuntimewinx64Version>
<SystemCollectionsImmutableVersion>9.0.3</SystemCollectionsImmutableVersion>
<SystemConfigurationConfigurationManagerVersion>9.0.3</SystemConfigurationConfigurationManagerVersion>
<SystemDiagnosticsDiagnosticSourceVersion>9.0.3</SystemDiagnosticsDiagnosticSourceVersion>
<SystemDiagnosticsPerformanceCounterVersion>9.0.3</SystemDiagnosticsPerformanceCounterVersion>
<SystemIOHashingVersion>9.0.3</SystemIOHashingVersion>
<SystemIOPipelinesVersion>9.0.3</SystemIOPipelinesVersion>
<SystemMemoryDataVersion>9.0.3</SystemMemoryDataVersion>
<SystemNetHttpJsonVersion>9.0.3</SystemNetHttpJsonVersion>
<SystemRuntimeCachingVersion>9.0.3</SystemRuntimeCachingVersion>
<SystemSecurityCryptographyPkcsVersion>9.0.3</SystemSecurityCryptographyPkcsVersion>
<SystemSecurityCryptographyXmlVersion>9.0.3</SystemSecurityCryptographyXmlVersion>
<SystemTextEncodingsWebVersion>9.0.3</SystemTextEncodingsWebVersion>
<SystemNumericsTensorsVersion>9.0.3</SystemNumericsTensorsVersion>
<SystemTextJsonVersion>9.0.3</SystemTextJsonVersion>
<SystemThreadingChannelsVersion>9.0.3</SystemThreadingChannelsVersion>
<MicrosoftBclAsyncInterfacesVersion>9.0.4</MicrosoftBclAsyncInterfacesVersion>
<MicrosoftBclTimeProviderVersion>9.0.4</MicrosoftBclTimeProviderVersion>
<MicrosoftExtensionsCachingAbstractionsVersion>9.0.4</MicrosoftExtensionsCachingAbstractionsVersion>
<MicrosoftExtensionsCachingMemoryVersion>9.0.4</MicrosoftExtensionsCachingMemoryVersion>
<MicrosoftExtensionsConfigurationAbstractionsVersion>9.0.4</MicrosoftExtensionsConfigurationAbstractionsVersion>
<MicrosoftExtensionsConfigurationBinderVersion>9.0.4</MicrosoftExtensionsConfigurationBinderVersion>
<MicrosoftExtensionsConfigurationJsonVersion>9.0.4</MicrosoftExtensionsConfigurationJsonVersion>
<MicrosoftExtensionsConfigurationVersion>9.0.4</MicrosoftExtensionsConfigurationVersion>
<MicrosoftExtensionsDependencyInjectionAbstractionsVersion>9.0.4</MicrosoftExtensionsDependencyInjectionAbstractionsVersion>
<MicrosoftExtensionsDependencyInjectionVersion>9.0.4</MicrosoftExtensionsDependencyInjectionVersion>
<MicrosoftExtensionsDiagnosticsVersion>9.0.4</MicrosoftExtensionsDiagnosticsVersion>
<MicrosoftExtensionsHostingAbstractionsVersion>9.0.4</MicrosoftExtensionsHostingAbstractionsVersion>
<MicrosoftExtensionsHostingVersion>9.0.4</MicrosoftExtensionsHostingVersion>
<MicrosoftExtensionsHttpVersion>9.0.4</MicrosoftExtensionsHttpVersion>
<MicrosoftExtensionsLoggingAbstractionsVersion>9.0.4</MicrosoftExtensionsLoggingAbstractionsVersion>
<MicrosoftExtensionsLoggingConfigurationVersion>9.0.4</MicrosoftExtensionsLoggingConfigurationVersion>
<MicrosoftExtensionsLoggingConsoleVersion>9.0.4</MicrosoftExtensionsLoggingConsoleVersion>
<MicrosoftExtensionsLoggingVersion>9.0.4</MicrosoftExtensionsLoggingVersion>
<MicrosoftExtensionsOptionsConfigurationExtensionsVersion>9.0.4</MicrosoftExtensionsOptionsConfigurationExtensionsVersion>
<MicrosoftExtensionsOptionsVersion>9.0.4</MicrosoftExtensionsOptionsVersion>
<MicrosoftNETCoreAppRefVersion>9.0.4</MicrosoftNETCoreAppRefVersion>
<MicrosoftNETCoreAppRuntimewinx64Version>9.0.4</MicrosoftNETCoreAppRuntimewinx64Version>
<SystemCollectionsImmutableVersion>9.0.4</SystemCollectionsImmutableVersion>
<SystemConfigurationConfigurationManagerVersion>9.0.4</SystemConfigurationConfigurationManagerVersion>
<SystemDiagnosticsDiagnosticSourceVersion>9.0.4</SystemDiagnosticsDiagnosticSourceVersion>
<SystemDiagnosticsPerformanceCounterVersion>9.0.4</SystemDiagnosticsPerformanceCounterVersion>
<SystemIOHashingVersion>9.0.4</SystemIOHashingVersion>
<SystemIOPipelinesVersion>9.0.4</SystemIOPipelinesVersion>
<SystemMemoryDataVersion>9.0.4</SystemMemoryDataVersion>
<SystemNetHttpJsonVersion>9.0.4</SystemNetHttpJsonVersion>
<SystemRuntimeCachingVersion>9.0.4</SystemRuntimeCachingVersion>
<SystemSecurityCryptographyPkcsVersion>9.0.4</SystemSecurityCryptographyPkcsVersion>
<SystemSecurityCryptographyXmlVersion>9.0.4</SystemSecurityCryptographyXmlVersion>
<SystemTextEncodingsWebVersion>9.0.4</SystemTextEncodingsWebVersion>
<SystemNumericsTensorsVersion>9.0.4</SystemNumericsTensorsVersion>
<SystemTextJsonVersion>9.0.4</SystemTextJsonVersion>
<SystemThreadingChannelsVersion>9.0.4</SystemThreadingChannelsVersion>
<!-- Dependencies from https://github.com/aspnet/AspNetCore -->
<MicrosoftAspNetCoreAppRefVersion>9.0.3</MicrosoftAspNetCoreAppRefVersion>
<MicrosoftAspNetCoreAppRuntimewinx64Version>9.0.3</MicrosoftAspNetCoreAppRuntimewinx64Version>
<MicrosoftAspNetCoreMvcTestingVersion>9.0.3</MicrosoftAspNetCoreMvcTestingVersion>
<MicrosoftAspNetCoreTestHostVersion>9.0.3</MicrosoftAspNetCoreTestHostVersion>
<MicrosoftExtensionsCachingSqlServerVersion>9.0.3</MicrosoftExtensionsCachingSqlServerVersion>
<MicrosoftExtensionsCachingStackExchangeRedisVersion>9.0.3</MicrosoftExtensionsCachingStackExchangeRedisVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksVersion>9.0.3</MicrosoftExtensionsDiagnosticsHealthChecksVersion>
<MicrosoftExtensionsHttpPollyVersion>9.0.3</MicrosoftExtensionsHttpPollyVersion>
<MicrosoftExtensionsObjectPoolVersion>9.0.3</MicrosoftExtensionsObjectPoolVersion>
<MicrosoftAspNetCoreAppRefVersion>9.0.4</MicrosoftAspNetCoreAppRefVersion>
<MicrosoftAspNetCoreAppRuntimewinx64Version>9.0.4</MicrosoftAspNetCoreAppRuntimewinx64Version>
<MicrosoftAspNetCoreMvcTestingVersion>9.0.4</MicrosoftAspNetCoreMvcTestingVersion>
<MicrosoftAspNetCoreTestHostVersion>9.0.4</MicrosoftAspNetCoreTestHostVersion>
<MicrosoftExtensionsCachingSqlServerVersion>9.0.4</MicrosoftExtensionsCachingSqlServerVersion>
<MicrosoftExtensionsCachingStackExchangeRedisVersion>9.0.4</MicrosoftExtensionsCachingStackExchangeRedisVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksVersion>9.0.4</MicrosoftExtensionsDiagnosticsHealthChecksVersion>
<MicrosoftExtensionsHttpPollyVersion>9.0.4</MicrosoftExtensionsHttpPollyVersion>
<MicrosoftExtensionsObjectPoolVersion>9.0.4</MicrosoftExtensionsObjectPoolVersion>
<!-- Dependencies from https://github.com/dotnet/efcore -->
<MicrosoftEntityFrameworkCoreSqliteVersion>9.0.3</MicrosoftEntityFrameworkCoreSqliteVersion>
<MicrosoftEntityFrameworkCoreSqliteVersion>9.0.4</MicrosoftEntityFrameworkCoreSqliteVersion>
<!-- Dependencies from https://github.com/dotnet/arcade -->
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25164.2</MicrosoftDotNetBuildTasksTemplatingVersion>
</PropertyGroup>
Expand Down Expand Up @@ -119,15 +128,15 @@
<SystemTextJsonLTSVersion>8.0.5</SystemTextJsonLTSVersion>
<SystemThreadingChannelsLTSVersion>8.0.0</SystemThreadingChannelsLTSVersion>
<!-- Dependencies from https://github.com/aspnet/AspNetCore -->
<MicrosoftAspNetCoreAppRefLTSVersion>8.0.14</MicrosoftAspNetCoreAppRefLTSVersion>
<MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>8.0.14</MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>
<MicrosoftAspNetCoreMvcTestingLTSVersion>8.0.14</MicrosoftAspNetCoreMvcTestingLTSVersion>
<MicrosoftAspNetCoreTestHostLTSVersion>8.0.14</MicrosoftAspNetCoreTestHostLTSVersion>
<MicrosoftExtensionsCachingSqlServerLTSVersion>8.0.14</MicrosoftExtensionsCachingSqlServerLTSVersion>
<MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>8.0.14</MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>8.0.14</MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>
<MicrosoftExtensionsHttpPollyLTSVersion>8.0.14</MicrosoftExtensionsHttpPollyLTSVersion>
<MicrosoftExtensionsObjectPoolLTSVersion>8.0.14</MicrosoftExtensionsObjectPoolLTSVersion>
<MicrosoftAspNetCoreAppRefLTSVersion>8.0.15</MicrosoftAspNetCoreAppRefLTSVersion>
<MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>8.0.15</MicrosoftAspNetCoreAppRuntimewinx64LTSVersion>
<MicrosoftAspNetCoreMvcTestingLTSVersion>8.0.15</MicrosoftAspNetCoreMvcTestingLTSVersion>
<MicrosoftAspNetCoreTestHostLTSVersion>8.0.15</MicrosoftAspNetCoreTestHostLTSVersion>
<MicrosoftExtensionsCachingSqlServerLTSVersion>8.0.15</MicrosoftExtensionsCachingSqlServerLTSVersion>
<MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>8.0.15</MicrosoftExtensionsCachingStackExchangeRedisLTSVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>8.0.15</MicrosoftExtensionsDiagnosticsHealthChecksLTSVersion>
<MicrosoftExtensionsHttpPollyLTSVersion>8.0.15</MicrosoftExtensionsHttpPollyLTSVersion>
<MicrosoftExtensionsObjectPoolLTSVersion>8.0.15</MicrosoftExtensionsObjectPoolLTSVersion>
</PropertyGroup>
<!--

Expand Down
1 change: 1 addition & 0 deletions eng/packages/General.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageVersion Include="Azure.Core" Version="1.45.0" />
<PackageVersion Include="Azure.Identity" Version="1.13.2" />
<PackageVersion Include="Azure.Storage.Files.DataLake" Version="12.21.0" />
<PackageVersion Include="Azure.AI.Inference" Version="1.0.0-beta.4" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,53 +180,60 @@ static async Task<ChatResponse> ToChatResponseAsync(
}
}

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

// Iterate through all of the items in the list looking for contiguous items that can be coalesced.
int start = 0;
while (start < contents.Count - 1)
// This implementation relies on TContent's ToString returning its exact text.
static void Coalesce<TContent>(List<AIContent> contents, Func<string, TContent> fromText)
where TContent : AIContent
{
// We need at least two TextContents in a row to be able to coalesce.
if (contents[start] is not TextContent firstText)
{
start++;
continue;
}

if (contents[start + 1] is not TextContent secondText)
{
start += 2;
continue;
}
StringBuilder? coalescedText = null;

// Append the text from those nodes and continue appending subsequent TextContents until we run out.
// We null out nodes as their text is appended so that we can later remove them all in one O(N) operation.
coalescedText ??= new();
_ = coalescedText.Clear().Append(firstText.Text).Append(secondText.Text);
contents[start + 1] = null!;
int i = start + 2;
for (; i < contents.Count && contents[i] is TextContent next; i++)
// Iterate through all of the items in the list looking for contiguous items that can be coalesced.
int start = 0;
while (start < contents.Count - 1)
{
_ = coalescedText.Append(next.Text);
contents[i] = null!;
// We need at least two TextContents in a row to be able to coalesce.
if (contents[start] is not TContent firstText)
{
start++;
continue;
}

if (contents[start + 1] is not TContent secondText)
{
start += 2;
continue;
}

// Append the text from those nodes and continue appending subsequent TextContents until we run out.
// We null out nodes as their text is appended so that we can later remove them all in one O(N) operation.
coalescedText ??= new();
_ = coalescedText.Clear().Append(firstText).Append(secondText);
contents[start + 1] = null!;
int i = start + 2;
for (; i < contents.Count && contents[i] is TContent next; i++)
{
_ = coalescedText.Append(next);
contents[i] = null!;
}

// Store the replacement node. We inherit the properties of the first text node. We don't
// currently propagate additional properties from the subsequent nodes. If we ever need to,
// we can add that here.
var newContent = fromText(coalescedText.ToString());
contents[start] = newContent;
newContent.AdditionalProperties = firstText.AdditionalProperties?.Clone();

start = i;
}

// Store the replacement node.
contents[start] = new TextContent(coalescedText.ToString())
{
// We inherit the properties of the first text node. We don't currently propagate additional
// properties from the subsequent nodes. If we ever need to, we can add that here.
AdditionalProperties = firstText.AdditionalProperties?.Clone(),
};

start = i;
// Remove all of the null slots left over from the coalescing process.
_ = contents.RemoveAll(u => u is null);
}

// Remove all of the null slots left over from the coalescing process.
_ = contents.RemoveAll(u => u is null);
}

/// <summary>Finalizes the <paramref name="response"/> object.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace Microsoft.Extensions.AI;
[JsonDerivedType(typeof(FunctionCallContent), typeDiscriminator: "functionCall")]
[JsonDerivedType(typeof(FunctionResultContent), typeDiscriminator: "functionResult")]
[JsonDerivedType(typeof(TextContent), typeDiscriminator: "text")]
[JsonDerivedType(typeof(TextReasoningContent), typeDiscriminator: "reasoning")]
[JsonDerivedType(typeof(UriContent), typeDiscriminator: "uri")]
[JsonDerivedType(typeof(UsageContent), typeDiscriminator: "usage")]
public class AIContent
Expand Down
Loading
Loading