@langchain/anthropic
Version:
Anthropic integrations for LangChain.js
1 lines • 3.27 kB
Source Map (JSON)
{"version":3,"file":"webSearch.d.ts","names":["Anthropic","ServerTool","WebSearch20250305Options","Beta","BetaCacheControlEphemeral","BetaWebSearchTool20250305","UserLocation","webSearch_20250305"],"sources":["../../src/tools/webSearch.d.ts"],"sourcesContent":["import Anthropic from \"@anthropic-ai/sdk\";\nimport { type ServerTool } from \"@langchain/core/tools\";\n/**\n * Options for the web search tool.\n */\nexport interface WebSearch20250305Options {\n /**\n * Maximum number of times the tool can be used in the API request.\n */\n maxUses?: number;\n /**\n * If provided, only these domains will be included in results. Cannot be used\n * alongside `blocked_domains`.\n */\n allowedDomains?: string[];\n /**\n * If provided, these domains will never appear in results. Cannot be used\n * alongside `allowed_domains`.\n */\n blockedDomains?: string[];\n /**\n * Create a cache control breakpoint at this content block.\n */\n cacheControl?: Anthropic.Beta.BetaCacheControlEphemeral;\n /**\n * Parameters for the user's location. Used to provide more relevant search\n * results.\n */\n userLocation?: Anthropic.Beta.BetaWebSearchTool20250305.UserLocation;\n /**\n * If true, tool will not be included in initial system prompt. Only loaded when\n * returned via tool_reference from tool search.\n */\n deferLoading?: boolean;\n /**\n * If true, tool will only return results from the allowed domains.\n */\n strict?: boolean;\n}\n/**\n * Creates a web search tool that gives Claude direct access to real-time web content,\n * allowing it to answer questions with up-to-date information beyond its knowledge cutoff.\n * Claude automatically cites sources from search results as part of its answer.\n *\n * @see {@link https://docs.anthropic.com/en/docs/build-with-claude/tool-use/web-search-tool | Anthropic Web Search Documentation}\n * @param options - Configuration options for the web search tool\n * @returns A web search tool definition to be passed to the Anthropic API\n *\n * @example\n * ```typescript\n * import { ChatAnthropic, tools } from \"@langchain/anthropic\";\n *\n * const model = new ChatAnthropic({\n * model: \"claude-sonnet-4-5-20250929\",\n * });\n *\n * // Basic usage\n * const response = await model.invoke(\"What is the weather in NYC?\", {\n * tools: [tools.webSearch_20250305()],\n * });\n *\n * // With options\n * const responseWithOptions = await model.invoke(\"Latest news about AI?\", {\n * tools: [tools.webSearch_20250305({\n * maxUses: 5,\n * allowedDomains: [\"reuters.com\", \"bbc.com\"],\n * userLocation: {\n * type: \"approximate\",\n * city: \"San Francisco\",\n * region: \"California\",\n * country: \"US\",\n * timezone: \"America/Los_Angeles\",\n * },\n * })],\n * });\n * ```\n */\nexport declare function webSearch_20250305(options?: WebSearch20250305Options): ServerTool;\n//# sourceMappingURL=webSearch.d.ts.map"],"mappings":";;;;;;;AAKA;AAwEwBO,UAxEPL,wBAAAA,CAwEoCA;;;;;;;;;;;;;;;;;;iBAtDlCF,SAAAA,CAAUG,IAAAA,CAAKC;;;;;iBAKfJ,SAAAA,CAAUG,IAAAA,CAAKE,yBAAAA,CAA0BC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiDpCC,kBAAAA,WAA6BL,2BAA2BD"}