openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.0.0-beta.1

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/Utility/ServerSentEvent.cs

24lines · modeblame

9f9f2936Jose Arriaga Maldonado2 years ago1#nullable enable
2
3namespace OpenAI;
4
5/// <summary>
6/// Represents an SSE event.
7/// See SSE specification: https://html.spec.whatwg.org/multipage/server-sent-events.html
8/// </summary>
9internal readonly struct ServerSentEvent
10{
11// Gets the value of the SSE "event type" buffer, used to distinguish
12// between event kinds.
13public string EventType { get; }
14
15// Gets the value of the SSE "data" buffer, which holds the payload of the
16// server-sent event.
17public string Data { get; }
18
19public ServerSentEvent(string type, string data)
20{
21EventType = type;
22Data = data;
23}
24}