Class BetaManagedAgentsInlineAgent.Skill
-
- All Implemented Interfaces:
public final class BetaManagedAgentsInlineAgent.SkillResolved skill as returned in API responses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsInlineAgent.Skill.VisitorAn interface that defines how to map each variant of Skill to a value of type T.
public final classBetaManagedAgentsInlineAgent.Skill.Type
-
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 Optional<JsonValue>_json()final BetaManagedAgentsInlineAgent.Skill.Typetype()final StringskillId()final Stringversion()final BooleanisAnthropic()final BooleanisCustom()final BetaManagedAgentsAnthropicSkillasAnthropic()A resolved Anthropic-managed skill. final BetaManagedAgentsCustomSkillasCustom()A resolved user-created custom skill. final <T extends Any> Taccept(BetaManagedAgentsInlineAgent.Skill.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsInlineAgent.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 BetaManagedAgentsInlineAgent.SkillofAnthropic(BetaManagedAgentsAnthropicSkill anthropic)A resolved Anthropic-managed skill. final static BetaManagedAgentsInlineAgent.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.
-
type
final BetaManagedAgentsInlineAgent.Skill.Type type()
-
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(BetaManagedAgentsInlineAgent.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 BetaManagedAgentsInlineAgent.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 BetaManagedAgentsInlineAgent.Skill ofAnthropic(BetaManagedAgentsAnthropicSkill anthropic)
A resolved Anthropic-managed skill.
-
ofCustom
final static BetaManagedAgentsInlineAgent.Skill ofCustom(BetaManagedAgentsCustomSkill custom)
A resolved user-created custom skill.
-
-
-
-