mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* 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
32 lines
973 B
C#
32 lines
973 B
C#
// 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;
|
|
}
|
|
}
|