Class BetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubric
-
- All Implemented Interfaces:
public final class BetaManagedAgentsDeploymentUserDefineOutcomeEvent.RubricRubric for grading the quality of an outcome.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubric.VisitorAn interface that defines how to map each variant of Rubric to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsFileRubric>file()Rubric referenced by a file uploaded via the Files API. final Optional<BetaManagedAgentsTextRubric>text()Rubric content provided inline as text. final BooleanisFile()final BooleanisText()final BetaManagedAgentsFileRubricasFile()Rubric referenced by a file uploaded via the Files API. final BetaManagedAgentsTextRubricasText()Rubric content provided inline as text. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubric.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubricvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsDeploymentUserDefineOutcomeEvent.RubricofFile(BetaManagedAgentsFileRubric file)Rubric referenced by a file uploaded via the Files API. final static BetaManagedAgentsDeploymentUserDefineOutcomeEvent.RubricofText(BetaManagedAgentsTextRubric text)Rubric content provided inline as text. -
-
Method Detail
-
file
final Optional<BetaManagedAgentsFileRubric> file()
Rubric referenced by a file uploaded via the Files API.
-
text
final Optional<BetaManagedAgentsTextRubric> text()
Rubric content provided inline as text.
-
asFile
final BetaManagedAgentsFileRubric asFile()
Rubric referenced by a file uploaded via the Files API.
-
asText
final BetaManagedAgentsTextRubric asText()
Rubric content provided inline as text.
-
accept
final <T extends Any> T accept(BetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubric.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 = rubric.accept(new Rubric.Visitor<Optional<String>>() { @Override public Optional<String> visitFile(BetaManagedAgentsFileRubric file) { return Optional.of(file.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubric 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.
-
ofFile
final static BetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubric ofFile(BetaManagedAgentsFileRubric file)
Rubric referenced by a file uploaded via the Files API.
-
ofText
final static BetaManagedAgentsDeploymentUserDefineOutcomeEvent.Rubric ofText(BetaManagedAgentsTextRubric text)
Rubric content provided inline as text.
-
-
-
-