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 · modecode

1#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.
13 public string EventType { get; }
14
15 // Gets the value of the SSE "data" buffer, which holds the payload of the
16 // server-sent event.
17 public string Data { get; }
18
19 public ServerSentEvent(string type, string data)
20 {
21 EventType = type;
22 Data = data;
23 }
24}
25