Class BetaCodeExecutionToolResultBlockContent
-
- All Implemented Interfaces:
public final class BetaCodeExecutionToolResultBlockContentCode execution result with encrypted stdout for PFC + web_search results.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaCodeExecutionToolResultBlockContent.VisitorAn interface that defines how to map each variant of BetaCodeExecutionToolResultBlockContent to a value of type T.
-
Method Summary
-
-
Method Detail
-
error
final Optional<BetaCodeExecutionToolResultError> error()
-
resultBlock
final Optional<BetaCodeExecutionResultBlock> resultBlock()
-
encryptedCodeExecutionResultBlock
final Optional<BetaEncryptedCodeExecutionResultBlock> encryptedCodeExecutionResultBlock()
Code execution result with encrypted stdout for PFC + web_search results.
-
isResultBlock
final Boolean isResultBlock()
-
isEncryptedCodeExecutionResultBlock
final Boolean isEncryptedCodeExecutionResultBlock()
-
asError
final BetaCodeExecutionToolResultError asError()
-
asResultBlock
final BetaCodeExecutionResultBlock asResultBlock()
-
asEncryptedCodeExecutionResultBlock
final BetaEncryptedCodeExecutionResultBlock asEncryptedCodeExecutionResultBlock()
Code execution result with encrypted stdout for PFC + web_search results.
-
accept
final <T extends Any> T accept(BetaCodeExecutionToolResultBlockContent.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.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = betaCodeExecutionToolResultBlockContent.accept(new BetaCodeExecutionToolResultBlockContent.Visitor<Optional<String>>() { @Override public Optional<String> visitError(BetaCodeExecutionToolResultError error) { return Optional.of(error.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaCodeExecutionToolResultBlockContent 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.
-
ofError
final static BetaCodeExecutionToolResultBlockContent ofError(BetaCodeExecutionToolResultError error)
-
ofResultBlock
final static BetaCodeExecutionToolResultBlockContent ofResultBlock(BetaCodeExecutionResultBlock resultBlock)
-
ofEncryptedCodeExecutionResultBlock
final static BetaCodeExecutionToolResultBlockContent ofEncryptedCodeExecutionResultBlock(BetaEncryptedCodeExecutionResultBlock encryptedCodeExecutionResultBlock)
Code execution result with encrypted stdout for PFC + web_search results.
-
-
-
-