Package org.springframework.ai.anthropic
Class AnthropicWebSearchTool
java.lang.Object
org.springframework.ai.anthropic.AnthropicWebSearchTool
Configuration for Anthropic's built-in web search tool. When enabled, Claude can search
the web during a conversation and use the results to generate cited responses.
Example usage:
var webSearch = AnthropicWebSearchTool.builder()
.allowedDomains(List.of("docs.spring.io", "github.com"))
.maxUses(5)
.build();
var options = AnthropicChatOptions.builder()
.webSearchTool(webSearch)
.build();
- Since:
- 1.0.0
- Author:
- Soby Chacko
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordApproximate user location for localizing web search results. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()@Nullable Long@Nullable AnthropicWebSearchTool.UserLocationvoidsetAllowedDomains(@Nullable List<String> allowedDomains) voidsetBlockedDomains(@Nullable List<String> blockedDomains) voidsetMaxUses(@Nullable Long maxUses) voidsetUserLocation(@Nullable AnthropicWebSearchTool.UserLocation userLocation)
-
Constructor Details
-
AnthropicWebSearchTool
public AnthropicWebSearchTool()
-
-
Method Details
-
builder
-
getAllowedDomains
-
setAllowedDomains
-
getBlockedDomains
-
setBlockedDomains
-
getMaxUses
-
setMaxUses
-
getUserLocation
-
setUserLocation
-