Class ResponseContentPartAddedEvent.Part
-
- All Implemented Interfaces:
public final class ResponseContentPartAddedEvent.PartThe content part that was added.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceResponseContentPartAddedEvent.Part.VisitorAn interface that defines how to map each variant of Part to a value of type T.
public final classResponseContentPartAddedEvent.Part.ReasoningTextReasoning text from the model.
-
Method Summary
-
-
Method Detail
-
outputText
final Optional<ResponseOutputText> outputText()
A text output from the model.
-
refusal
final Optional<ResponseOutputRefusal> refusal()
A refusal from the model.
-
reasoningText
final Optional<ResponseContentPartAddedEvent.Part.ReasoningText> reasoningText()
Reasoning text from the model.
-
isOutputText
final Boolean isOutputText()
-
isReasoningText
final Boolean isReasoningText()
-
asOutputText
final ResponseOutputText asOutputText()
A text output from the model.
-
asRefusal
final ResponseOutputRefusal asRefusal()
A refusal from the model.
-
asReasoningText
final ResponseContentPartAddedEvent.Part.ReasoningText asReasoningText()
Reasoning text from the model.
-
accept
final <T extends Any> T accept(ResponseContentPartAddedEvent.Part.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 = part.accept(new Part.Visitor<Optional<String>>() { @Override public Optional<String> visitOutputText(ResponseOutputText outputText) { return Optional.of(outputText.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ResponseContentPartAddedEvent.Part 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.
-
ofOutputText
final static ResponseContentPartAddedEvent.Part ofOutputText(ResponseOutputText outputText)
A text output from the model.
-
ofRefusal
final static ResponseContentPartAddedEvent.Part ofRefusal(ResponseOutputRefusal refusal)
A refusal from the model.
-
ofReasoningText
final static ResponseContentPartAddedEvent.Part ofReasoningText(ResponseContentPartAddedEvent.Part.ReasoningText reasoningText)
Reasoning text from the model.
-
-
-
-