openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.0.0-beta.12

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/Custom/Assistants/Streaming/RunStepUpdate.cs

29lines · modecode

1using System.ClientModel.Primitives;
2using System.Collections.Generic;
3using System.Diagnostics.CodeAnalysis;
4using System.Text.Json;
5
6namespace OpenAI.Assistants;
7
8/// <summary>
9/// The update type presented when the status of a run step changes.
10/// </summary>
11[Experimental("OPENAI001")]
12public class RunStepUpdate : StreamingUpdate<RunStep>
13{
14 internal RunStepUpdate(RunStep runStep, StreamingUpdateReason updateKind)
15 : base(runStep, updateKind)
16 { }
17
18 internal static IEnumerable<StreamingUpdate<RunStep>> DeserializeRunStepUpdates(
19 JsonElement element,
20 StreamingUpdateReason updateKind,
21 ModelReaderWriterOptions options = null)
22 {
23 RunStep runStep = RunStep.DeserializeRunStep(element, options);
24 return updateKind switch
25 {
26 _ => [new RunStepUpdate(runStep, updateKind)],
27 };
28 }
29}