Approval Request Types (Step04_HumanInLoop.Client/ApprovalTypes.cs)

ag-ui · sdks/dotnet/samples/GettingStarted/Step04_HumanInLoop/Step04_HumanInLoop.Client/ApprovalTypes.cs · csharp · MIT
ai, dev-tools, lang:csharp, tag:serialization, tag:human-in-loop

C# DTOs modeling human-in-the-loop approval requests and responses with JSON serialization. Reuse when implementing approval workflows in .NET AG-UI clients.

// Source: https://github.com/ag-ui-protocol/ag-ui | License: MIT | Copyright 2025
// Provided via justclaw.it.com; keep this notice with the code.
using System.Text.Json;
using System.Text.Json.Serialization;

namespace Step04_HumanInLoop.Client;

internal sealed class ApprovalRequest
{
    [JsonPropertyName("approval_id")]
    public required string ApprovalId { get; init; }

    [JsonPropertyName("function_name")]
    public required string FunctionName { get; init; }

    [JsonPropertyName("function_arguments")]
    public JsonElement? FunctionArguments { get; init; }

    [JsonPropertyName("message")]
    public string? Message { get; init; }
}

internal sealed class ApprovalResponse
{
    [JsonPropertyName("approval_id")]
    public required string ApprovalId { get; init; }

    [Jso

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key