Class RunStep.StepDetails
-
- All Implemented Interfaces:
public final class RunStep.StepDetailsThe details of the run step.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRunStep.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<MessageCreationStepDetails>messageCreation()Details of the message creation by the run step. final Optional<ToolCallsStepDetails>toolCalls()Details of the tool call. final BooleanisMessageCreation()final BooleanisToolCalls()final MessageCreationStepDetailsasMessageCreation()Details of the message creation by the run step. final ToolCallsStepDetailsasToolCalls()Details of the tool call. final Optional<JsonValue>_json()final <T extends Any> Taccept(RunStep.StepDetails.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final RunStep.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 RunStep.StepDetailsofMessageCreation(MessageCreationStepDetails messageCreation)Details of the message creation by the run step. final static RunStep.StepDetailsofToolCalls(ToolCallsStepDetails toolCalls)Details of the tool call. -
-
Method Detail
-
messageCreation
final Optional<MessageCreationStepDetails> messageCreation()
Details of the message creation by the run step.
-
toolCalls
final Optional<ToolCallsStepDetails> toolCalls()
Details of the tool call.
-
isMessageCreation
final Boolean isMessageCreation()
-
isToolCalls
final Boolean isToolCalls()
-
asMessageCreation
final MessageCreationStepDetails asMessageCreation()
Details of the message creation by the run step.
-
asToolCalls
final ToolCallsStepDetails asToolCalls()
Details of the tool call.
-
accept
final <T extends Any> T accept(RunStep.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(MessageCreationStepDetails messageCreation) { return Optional.of(messageCreation.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RunStep.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 RunStep.StepDetails ofMessageCreation(MessageCreationStepDetails messageCreation)
Details of the message creation by the run step.
-
ofToolCalls
final static RunStep.StepDetails ofToolCalls(ToolCallsStepDetails toolCalls)
Details of the tool call.
-
-
-
-