Class RunStepStreamEvent
-
- All Implemented Interfaces:
public final class RunStepStreamEventOccurs when a run step is created.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRunStepStreamEvent.VisitorAn interface that defines how to map each variant of RunStepStreamEvent to a value of type T.
public final classRunStepStreamEvent.ThreadRunStepCreatedOccurs when a run step is created.
public final classRunStepStreamEvent.ThreadRunStepInProgressOccurs when a run step moves to an
in_progressstate.public final classRunStepStreamEvent.ThreadRunStepDeltaOccurs when parts of a run step are being streamed.
public final classRunStepStreamEvent.ThreadRunStepCompletedOccurs when a run step is completed.
public final classRunStepStreamEvent.ThreadRunStepFailedOccurs when a run step fails.
public final classRunStepStreamEvent.ThreadRunStepCancelledOccurs when a run step is cancelled.
public final classRunStepStreamEvent.ThreadRunStepExpiredOccurs when a run step expires.
-
Method Summary
-
-
Method Detail
-
threadRunStepCreated
final Optional<RunStepStreamEvent.ThreadRunStepCreated> threadRunStepCreated()
Occurs when a run step is created.
-
threadRunStepInProgress
final Optional<RunStepStreamEvent.ThreadRunStepInProgress> threadRunStepInProgress()
Occurs when a run step moves to an
in_progressstate.
-
threadRunStepDelta
final Optional<RunStepStreamEvent.ThreadRunStepDelta> threadRunStepDelta()
Occurs when parts of a run step are being streamed.
-
threadRunStepCompleted
final Optional<RunStepStreamEvent.ThreadRunStepCompleted> threadRunStepCompleted()
Occurs when a run step is completed.
-
threadRunStepFailed
final Optional<RunStepStreamEvent.ThreadRunStepFailed> threadRunStepFailed()
Occurs when a run step fails.
-
threadRunStepCancelled
final Optional<RunStepStreamEvent.ThreadRunStepCancelled> threadRunStepCancelled()
Occurs when a run step is cancelled.
-
threadRunStepExpired
final Optional<RunStepStreamEvent.ThreadRunStepExpired> threadRunStepExpired()
Occurs when a run step expires.
-
isThreadRunStepCreated
final Boolean isThreadRunStepCreated()
-
isThreadRunStepInProgress
final Boolean isThreadRunStepInProgress()
-
isThreadRunStepDelta
final Boolean isThreadRunStepDelta()
-
isThreadRunStepCompleted
final Boolean isThreadRunStepCompleted()
-
isThreadRunStepFailed
final Boolean isThreadRunStepFailed()
-
isThreadRunStepCancelled
final Boolean isThreadRunStepCancelled()
-
isThreadRunStepExpired
final Boolean isThreadRunStepExpired()
-
asThreadRunStepCreated
final RunStepStreamEvent.ThreadRunStepCreated asThreadRunStepCreated()
Occurs when a run step is created.
-
asThreadRunStepInProgress
final RunStepStreamEvent.ThreadRunStepInProgress asThreadRunStepInProgress()
Occurs when a run step moves to an
in_progressstate.
-
asThreadRunStepDelta
final RunStepStreamEvent.ThreadRunStepDelta asThreadRunStepDelta()
Occurs when parts of a run step are being streamed.
-
asThreadRunStepCompleted
final RunStepStreamEvent.ThreadRunStepCompleted asThreadRunStepCompleted()
Occurs when a run step is completed.
-
asThreadRunStepFailed
final RunStepStreamEvent.ThreadRunStepFailed asThreadRunStepFailed()
Occurs when a run step fails.
-
asThreadRunStepCancelled
final RunStepStreamEvent.ThreadRunStepCancelled asThreadRunStepCancelled()
Occurs when a run step is cancelled.
-
asThreadRunStepExpired
final RunStepStreamEvent.ThreadRunStepExpired asThreadRunStepExpired()
Occurs when a run step expires.
-
accept
final <T extends Any> T accept(RunStepStreamEvent.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = runStepStreamEvent.accept(new RunStepStreamEvent.Visitor<Optional<String>>() { @Override public Optional<String> visitThreadRunStepCreated(ThreadRunStepCreated threadRunStepCreated) { return Optional.of(threadRunStepCreated.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RunStepStreamEvent validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofThreadRunStepCreated
final static RunStepStreamEvent ofThreadRunStepCreated(RunStepStreamEvent.ThreadRunStepCreated threadRunStepCreated)
Occurs when a run step is created.
-
ofThreadRunStepInProgress
final static RunStepStreamEvent ofThreadRunStepInProgress(RunStepStreamEvent.ThreadRunStepInProgress threadRunStepInProgress)
Occurs when a run step moves to an
in_progressstate.
-
ofThreadRunStepDelta
final static RunStepStreamEvent ofThreadRunStepDelta(RunStepStreamEvent.ThreadRunStepDelta threadRunStepDelta)
Occurs when parts of a run step are being streamed.
-
ofThreadRunStepCompleted
final static RunStepStreamEvent ofThreadRunStepCompleted(RunStepStreamEvent.ThreadRunStepCompleted threadRunStepCompleted)
Occurs when a run step is completed.
-
ofThreadRunStepFailed
final static RunStepStreamEvent ofThreadRunStepFailed(RunStepStreamEvent.ThreadRunStepFailed threadRunStepFailed)
Occurs when a run step fails.
-
ofThreadRunStepCancelled
final static RunStepStreamEvent ofThreadRunStepCancelled(RunStepStreamEvent.ThreadRunStepCancelled threadRunStepCancelled)
Occurs when a run step is cancelled.
-
ofThreadRunStepExpired
final static RunStepStreamEvent ofThreadRunStepExpired(RunStepStreamEvent.ThreadRunStepExpired threadRunStepExpired)
Occurs when a run step expires.
-
-
-
-