mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
.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:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user