Class BetaWebFetchUrlSources.UserInput
-
- All Implemented Interfaces:
public final class BetaWebFetchUrlSources.UserInputWhether URLs in user messages are fetchable: "all" or "none".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaWebFetchUrlSources.UserInput.VisitorAn interface that defines how to map each variant of UserInput to a value of type T.
public final classBetaWebFetchUrlSources.UserInput.Type
-
Method Summary
Modifier and Type Method Description final Optional<BetaWebFetchUrlSourceAll>all()The `url_sources`variant under which a source contributes in full: every result of the tool filter's source, or all user input.final Optional<BetaWebFetchUrlSourceNone>none()The `url_sources`variant under which a source contributes nothing: no result of the tool filter's source, or no user input.final Optional<JsonValue>_json()final BetaWebFetchUrlSources.UserInput.Typetype()final BooleanisAll()final BooleanisNone()final BetaWebFetchUrlSourceAllasAll()The `url_sources`variant under which a source contributes in full: every result of the tool filter's source, or all user input.final BetaWebFetchUrlSourceNoneasNone()The `url_sources`variant under which a source contributes nothing: no result of the tool filter's source, or no user input.final <T extends Any> Taccept(BetaWebFetchUrlSources.UserInput.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaWebFetchUrlSources.UserInputvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaWebFetchUrlSources.UserInputofAll(BetaWebFetchUrlSourceAll all)The `url_sources`variant under which a source contributes in full: every result of the tool filter's source, or all user input.final static BetaWebFetchUrlSources.UserInputofNone(BetaWebFetchUrlSourceNone none)The `url_sources`variant under which a source contributes nothing: no result of the tool filter's source, or no user input.-
-
Method Detail
-
all
final Optional<BetaWebFetchUrlSourceAll> all()
The
`url_sources`variant under which a source contributes in full: every result of the tool filter's source, or all user input.
-
none
final Optional<BetaWebFetchUrlSourceNone> none()
The
`url_sources`variant under which a source contributes nothing: no result of the tool filter's source, or no user input.
-
type
final BetaWebFetchUrlSources.UserInput.Type type()
-
asAll
final BetaWebFetchUrlSourceAll asAll()
The
`url_sources`variant under which a source contributes in full: every result of the tool filter's source, or all user input.
-
asNone
final BetaWebFetchUrlSourceNone asNone()
The
`url_sources`variant under which a source contributes nothing: no result of the tool filter's source, or no user input.
-
accept
final <T extends Any> T accept(BetaWebFetchUrlSources.UserInput.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 = userInput.accept(new UserInput.Visitor<Optional<String>>() { @Override public Optional<String> visitAll(BetaWebFetchUrlSourceAll all) { return Optional.of(all.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaWebFetchUrlSources.UserInput 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.
-
ofAll
final static BetaWebFetchUrlSources.UserInput ofAll(BetaWebFetchUrlSourceAll all)
The
`url_sources`variant under which a source contributes in full: every result of the tool filter's source, or all user input.
-
ofNone
final static BetaWebFetchUrlSources.UserInput ofNone(BetaWebFetchUrlSourceNone none)
The
`url_sources`variant under which a source contributes nothing: no result of the tool filter's source, or no user input.
-
-
-
-