Class BetaManagedAgentsSessionThreadAgent.Skill
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionThreadAgent.SkillResolved skill as returned in API responses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsSessionThreadAgent.Skill.VisitorAn interface that defines how to map each variant of Skill to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsAnthropicSkill>anthropic()A resolved Anthropic-managed skill. final Optional<BetaManagedAgentsCustomSkill>custom()A resolved user-created custom skill. final BooleanisAnthropic()final BooleanisCustom()final BetaManagedAgentsAnthropicSkillasAnthropic()A resolved Anthropic-managed skill. final BetaManagedAgentsCustomSkillasCustom()A resolved user-created custom skill. final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsSessionThreadAgent.Skill.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsSessionThreadAgent.Skillvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsSessionThreadAgent.SkillofAnthropic(BetaManagedAgentsAnthropicSkill anthropic)A resolved Anthropic-managed skill. final static BetaManagedAgentsSessionThreadAgent.SkillofCustom(BetaManagedAgentsCustomSkill custom)A resolved user-created custom skill. -
-
Method Detail
-
anthropic
final Optional<BetaManagedAgentsAnthropicSkill> anthropic()
A resolved Anthropic-managed skill.
-
custom
final Optional<BetaManagedAgentsCustomSkill> custom()
A resolved user-created custom skill.
-
isAnthropic
final Boolean isAnthropic()
-
asAnthropic
final BetaManagedAgentsAnthropicSkill asAnthropic()
A resolved Anthropic-managed skill.
-
asCustom
final BetaManagedAgentsCustomSkill asCustom()
A resolved user-created custom skill.
-
accept
final <T extends Any> T accept(BetaManagedAgentsSessionThreadAgent.Skill.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 = skill.accept(new Skill.Visitor<Optional<String>>() { @Override public Optional<String> visitAnthropic(BetaManagedAgentsAnthropicSkill anthropic) { return Optional.of(anthropic.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsSessionThreadAgent.Skill 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.
-
ofAnthropic
final static BetaManagedAgentsSessionThreadAgent.Skill ofAnthropic(BetaManagedAgentsAnthropicSkill anthropic)
A resolved Anthropic-managed skill.
-
ofCustom
final static BetaManagedAgentsSessionThreadAgent.Skill ofCustom(BetaManagedAgentsCustomSkill custom)
A resolved user-created custom skill.
-
-
-
-