Class WebFetchUrlSources.UserInput
-
- All Implemented Interfaces:
public final class WebFetchUrlSources.UserInputWhether URLs in user messages are fetchable: "all" or "none".
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceWebFetchUrlSources.UserInput.VisitorAn interface that defines how to map each variant of UserInput to a value of type T.
public final classWebFetchUrlSources.UserInput.Type
-
Method Summary
Modifier and Type Method Description final Optional<WebFetchUrlSourceAll>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<WebFetchUrlSourceNone>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 WebFetchUrlSources.UserInput.Typetype()final BooleanisAll()final BooleanisNone()final WebFetchUrlSourceAllasAll()The `url_sources`variant under which a source contributes in full: every result of the tool filter's source, or all user input.final WebFetchUrlSourceNoneasNone()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(WebFetchUrlSources.UserInput.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final WebFetchUrlSources.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 WebFetchUrlSources.UserInputofAll(WebFetchUrlSourceAll 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 WebFetchUrlSources.UserInputofNone(WebFetchUrlSourceNone 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<WebFetchUrlSourceAll> 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<WebFetchUrlSourceNone> 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 WebFetchUrlSources.UserInput.Type type()
-
asAll
final WebFetchUrlSourceAll 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 WebFetchUrlSourceNone 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(WebFetchUrlSources.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(WebFetchUrlSourceAll all) { return Optional.of(all.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final WebFetchUrlSources.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 WebFetchUrlSources.UserInput ofAll(WebFetchUrlSourceAll 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 WebFetchUrlSources.UserInput ofNone(WebFetchUrlSourceNone none)
The
`url_sources`variant under which a source contributes nothing: no result of the tool filter's source, or no user input.
-
-
-
-