.NET: Improve fidelity of OpenAI Responses server and add Conversations (#1907)

* Improve fidelity of OpenAI Responses server and add Conversations

* Merge

* nit

* Undo prior change

* Undo prior change

* Review feedback

* Review feedback

* Fix test

* Use simpler JsonDocument approach for polymorphic deserialization

* More review feedback

* dotnet format
This commit is contained in:
Reuben Bond
2025-11-05 18:46:19 +00:00
committed by GitHub
parent e2282ebe42
commit 33f84f9ed2
135 changed files with 11718 additions and 1243 deletions
@@ -0,0 +1,31 @@
// Copyright (c) Microsoft. All rights reserved.
using Microsoft.Agents.AI.Hosting.OpenAI.Models;
namespace Microsoft.Agents.AI.Hosting.OpenAI.Conversations;
/// <summary>
/// Extension methods for <see cref="SortOrder"/>.
/// </summary>
internal static class SortOrderExtensions
{
/// <summary>
/// Converts a <see cref="SortOrder"/> to its string representation.
/// </summary>
/// <param name="order">The sort order.</param>
/// <returns>The string representation ("asc" or "desc").</returns>
public static string ToOrderString(this SortOrder order)
{
return order == SortOrder.Ascending ? "asc" : "desc";
}
/// <summary>
/// Checks if the sort order is ascending.
/// </summary>
/// <param name="order">The sort order.</param>
/// <returns>True if ascending, false otherwise.</returns>
public static bool IsAscending(this SortOrder order)
{
return order == SortOrder.Ascending;
}
}