//#region src/tools/web_search.ts
/**
* xAI Web Search tool type constant.
*/
const XAI_WEB_SEARCH_TOOL_TYPE = "web_search";
/**
* Creates an xAI web search tool.
* Enables the model to search the web and browse pages for real-time information.
*
* This tool is executed server-side by the xAI API as part of the agentic
* tool calling workflow.
*
* @param options - Configuration options for the web search tool
* @returns An XAIWebSearchTool object to pass to the model
*
* @example Basic usage
* ```typescript
* import { ChatXAIResponses, tools } from "@langchain/xai";
*
* const llm = new ChatXAIResponses({
*   model: "grok-4-1-fast",
* });
*
* const webSearch = tools.xaiWebSearch();
* const result = await llm.invoke("What are the latest AI developments?", {
*   tools: [webSearch],
* });
* ```
*
* @example With domain filtering
* ```typescript
* const webSearch = tools.xaiWebSearch({
*   allowedDomains: ["wikipedia.org", "arxiv.org"],
*   enableImageUnderstanding: true,
* });
* ```
*
* @example Excluding specific domains
* ```typescript
* const webSearch = tools.xaiWebSearch({
*   excludedDomains: ["example.com"],
* });
* ```
*/
function xaiWebSearch(options = {}) {
	const tool = { type: XAI_WEB_SEARCH_TOOL_TYPE };
	if (options.allowedDomains !== void 0) tool.allowed_domains = options.allowedDomains;
	if (options.excludedDomains !== void 0) tool.excluded_domains = options.excludedDomains;
	if (options.enableImageUnderstanding !== void 0) tool.enable_image_understanding = options.enableImageUnderstanding;
	return tool;
}

//#endregion
export { XAI_WEB_SEARCH_TOOL_TYPE, xaiWebSearch };
//# sourceMappingURL=web_search.js.map