Class RunStepDelta.StepDetails
-
- All Implemented Interfaces:
public final class RunStepDelta.StepDetailsThe details of the run step.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRunStepDelta.StepDetails.VisitorAn interface that defines how to map each variant of StepDetails to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<RunStepDeltaMessageDelta>messageCreation()Details of the message creation by the run step. final Optional<ToolCallDeltaObject>toolCalls()Details of the tool call. final BooleanisMessageCreation()final BooleanisToolCalls()final RunStepDeltaMessageDeltaasMessageCreation()Details of the message creation by the run step. final ToolCallDeltaObjectasToolCalls()Details of the tool call. final Optional<JsonValue>_json()final <T extends Any> Taccept(RunStepDelta.StepDetails.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RunStepDelta.StepDetailsvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static RunStepDelta.StepDetailsofMessageCreation(RunStepDeltaMessageDelta messageCreation)Details of the message creation by the run step. final static RunStepDelta.StepDetailsofToolCalls(ToolCallDeltaObject toolCalls)Details of the tool call. -
-
Method Detail
-
messageCreation
final Optional<RunStepDeltaMessageDelta> messageCreation()
Details of the message creation by the run step.
-
toolCalls
final Optional<ToolCallDeltaObject> toolCalls()
Details of the tool call.
-
isMessageCreation
final Boolean isMessageCreation()
-
isToolCalls
final Boolean isToolCalls()
-
asMessageCreation
final RunStepDeltaMessageDelta asMessageCreation()
Details of the message creation by the run step.
-
asToolCalls
final ToolCallDeltaObject asToolCalls()
Details of the tool call.
-
accept
final <T extends Any> T accept(RunStepDelta.StepDetails.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 = stepDetails.accept(new StepDetails.Visitor<Optional<String>>() { @Override public Optional<String> visitMessageCreation(RunStepDeltaMessageDelta messageCreation) { return Optional.of(messageCreation.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RunStepDelta.StepDetails 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.
-
ofMessageCreation
final static RunStepDelta.StepDetails ofMessageCreation(RunStepDeltaMessageDelta messageCreation)
Details of the message creation by the run step.
-
ofToolCalls
final static RunStepDelta.StepDetails ofToolCalls(ToolCallDeltaObject toolCalls)
Details of the tool call.
-
-
-
-