openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.0.0-beta.4

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Utility/ServerSentEvent.cs

24lines · modepreview

#nullable enable

namespace OpenAI;

/// <summary>
/// Represents an SSE event.
/// See SSE specification: https://html.spec.whatwg.org/multipage/server-sent-events.html
/// </summary>
internal readonly struct ServerSentEvent
{
    // Gets the value of the SSE "event type" buffer, used to distinguish
    // between event kinds.
    public string EventType { get; }

    // Gets the value of the SSE "data" buffer, which holds the payload of the
    // server-sent event.
    public string Data { get; }

    public ServerSentEvent(string type, string data)
    {
        EventType = type;
        Data = data;
    }
}