Package com.openai.models.responses
Class ContainerAuto.Skill
-
- All Implemented Interfaces:
public final class ContainerAuto.Skill
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceContainerAuto.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<SkillReference>reference()final Optional<InlineSkill>inline()final BooleanisReference()final BooleanisInline()final SkillReferenceasReference()final InlineSkillasInline()final Optional<JsonValue>_json()final <T extends Any> Taccept(ContainerAuto.Skill.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ContainerAuto.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 ContainerAuto.SkillofReference(SkillReference reference)final static ContainerAuto.SkillofInline(InlineSkill inline)-
-
Method Detail
-
reference
final Optional<SkillReference> reference()
-
inline
final Optional<InlineSkill> inline()
-
isReference
final Boolean isReference()
-
asReference
final SkillReference asReference()
-
asInline
final InlineSkill asInline()
-
accept
final <T extends Any> T accept(ContainerAuto.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.openai.core.JsonValue; import java.util.Optional; Optional<String> result = skill.accept(new Skill.Visitor<Optional<String>>() { @Override public Optional<String> visitReference(SkillReference reference) { return Optional.of(reference.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ContainerAuto.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.
-
ofReference
final static ContainerAuto.Skill ofReference(SkillReference reference)
-
ofInline
final static ContainerAuto.Skill ofInline(InlineSkill inline)
-
-
-
-