@langchain/xai 1.2.2 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/chat_models/completions.cjs +1 -1
  3. package/dist/chat_models/completions.cjs.map +1 -1
  4. package/dist/chat_models/completions.d.cts +5 -0
  5. package/dist/chat_models/completions.d.cts.map +1 -1
  6. package/dist/chat_models/completions.d.ts +5 -0
  7. package/dist/chat_models/completions.d.ts.map +1 -1
  8. package/dist/chat_models/completions.js +1 -1
  9. package/dist/chat_models/completions.js.map +1 -1
  10. package/dist/chat_models/responses-types.d.cts +37 -7
  11. package/dist/chat_models/responses-types.d.cts.map +1 -1
  12. package/dist/chat_models/responses-types.d.ts +37 -7
  13. package/dist/chat_models/responses-types.d.ts.map +1 -1
  14. package/dist/chat_models/responses.cjs +5 -0
  15. package/dist/chat_models/responses.cjs.map +1 -1
  16. package/dist/chat_models/responses.d.cts +2 -1
  17. package/dist/chat_models/responses.d.cts.map +1 -1
  18. package/dist/chat_models/responses.d.ts +2 -1
  19. package/dist/chat_models/responses.d.ts.map +1 -1
  20. package/dist/chat_models/responses.js +5 -0
  21. package/dist/chat_models/responses.js.map +1 -1
  22. package/dist/tools/code_execution.cjs +52 -0
  23. package/dist/tools/code_execution.cjs.map +1 -0
  24. package/dist/tools/code_execution.d.cts +64 -0
  25. package/dist/tools/code_execution.d.cts.map +1 -0
  26. package/dist/tools/code_execution.d.ts +64 -0
  27. package/dist/tools/code_execution.d.ts.map +1 -0
  28. package/dist/tools/code_execution.js +50 -0
  29. package/dist/tools/code_execution.js.map +1 -0
  30. package/dist/tools/collections_search.cjs +60 -0
  31. package/dist/tools/collections_search.cjs.map +1 -0
  32. package/dist/tools/collections_search.d.cts +90 -0
  33. package/dist/tools/collections_search.d.cts.map +1 -0
  34. package/dist/tools/collections_search.d.ts +90 -0
  35. package/dist/tools/collections_search.d.ts.map +1 -0
  36. package/dist/tools/collections_search.js +58 -0
  37. package/dist/tools/collections_search.js.map +1 -0
  38. package/dist/tools/index.cjs +11 -1
  39. package/dist/tools/index.cjs.map +1 -1
  40. package/dist/tools/index.d.cts +10 -1
  41. package/dist/tools/index.d.cts.map +1 -1
  42. package/dist/tools/index.d.ts +10 -1
  43. package/dist/tools/index.d.ts.map +1 -1
  44. package/dist/tools/index.js +12 -2
  45. package/dist/tools/index.js.map +1 -1
  46. package/dist/tools/live_search.cjs +14 -0
  47. package/dist/tools/live_search.cjs.map +1 -1
  48. package/dist/tools/live_search.d.cts +14 -1
  49. package/dist/tools/live_search.d.cts.map +1 -1
  50. package/dist/tools/live_search.d.ts +14 -1
  51. package/dist/tools/live_search.d.ts.map +1 -1
  52. package/dist/tools/live_search.js +14 -1
  53. package/dist/tools/live_search.js.map +1 -1
  54. package/dist/tools/web_search.cjs +57 -0
  55. package/dist/tools/web_search.cjs.map +1 -0
  56. package/dist/tools/web_search.d.cts +104 -0
  57. package/dist/tools/web_search.d.cts.map +1 -0
  58. package/dist/tools/web_search.d.ts +104 -0
  59. package/dist/tools/web_search.d.ts.map +1 -0
  60. package/dist/tools/web_search.js +55 -0
  61. package/dist/tools/web_search.js.map +1 -0
  62. package/dist/tools/x_search.cjs +63 -0
  63. package/dist/tools/x_search.cjs.map +1 -0
  64. package/dist/tools/x_search.d.cts +145 -0
  65. package/dist/tools/x_search.d.cts.map +1 -0
  66. package/dist/tools/x_search.d.ts +145 -0
  67. package/dist/tools/x_search.d.ts.map +1 -0
  68. package/dist/tools/x_search.js +61 -0
  69. package/dist/tools/x_search.js.map +1 -0
  70. package/package.json +5 -5
@@ -0,0 +1,55 @@
1
+ //#region src/tools/web_search.ts
2
+ /**
3
+ * xAI Web Search tool type constant.
4
+ */
5
+ const XAI_WEB_SEARCH_TOOL_TYPE = "web_search";
6
+ /**
7
+ * Creates an xAI web search tool.
8
+ * Enables the model to search the web and browse pages for real-time information.
9
+ *
10
+ * This tool is executed server-side by the xAI API as part of the agentic
11
+ * tool calling workflow.
12
+ *
13
+ * @param options - Configuration options for the web search tool
14
+ * @returns An XAIWebSearchTool object to pass to the model
15
+ *
16
+ * @example Basic usage
17
+ * ```typescript
18
+ * import { ChatXAIResponses, tools } from "@langchain/xai";
19
+ *
20
+ * const llm = new ChatXAIResponses({
21
+ * model: "grok-4-1-fast",
22
+ * });
23
+ *
24
+ * const webSearch = tools.xaiWebSearch();
25
+ * const result = await llm.invoke("What are the latest AI developments?", {
26
+ * tools: [webSearch],
27
+ * });
28
+ * ```
29
+ *
30
+ * @example With domain filtering
31
+ * ```typescript
32
+ * const webSearch = tools.xaiWebSearch({
33
+ * allowedDomains: ["wikipedia.org", "arxiv.org"],
34
+ * enableImageUnderstanding: true,
35
+ * });
36
+ * ```
37
+ *
38
+ * @example Excluding specific domains
39
+ * ```typescript
40
+ * const webSearch = tools.xaiWebSearch({
41
+ * excludedDomains: ["example.com"],
42
+ * });
43
+ * ```
44
+ */
45
+ function xaiWebSearch(options = {}) {
46
+ const tool = { type: XAI_WEB_SEARCH_TOOL_TYPE };
47
+ if (options.allowedDomains !== void 0) tool.allowed_domains = options.allowedDomains;
48
+ if (options.excludedDomains !== void 0) tool.excluded_domains = options.excludedDomains;
49
+ if (options.enableImageUnderstanding !== void 0) tool.enable_image_understanding = options.enableImageUnderstanding;
50
+ return tool;
51
+ }
52
+
53
+ //#endregion
54
+ export { XAI_WEB_SEARCH_TOOL_TYPE, xaiWebSearch };
55
+ //# sourceMappingURL=web_search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web_search.js","names":["options: XAIWebSearchToolOptions","tool: XAIWebSearchTool"],"sources":["../../src/tools/web_search.ts"],"sourcesContent":["/**\n * xAI Web Search tool type constant.\n */\nexport const XAI_WEB_SEARCH_TOOL_TYPE = \"web_search\";\n\n/**\n * xAI's built-in web search tool interface.\n * Enables the model to search the web and browse pages for real-time information.\n *\n * This tool is part of xAI's agentic tool calling API.\n */\nexport interface XAIWebSearchTool {\n /**\n * The type of the tool. Must be \"web_search\".\n */\n type: typeof XAI_WEB_SEARCH_TOOL_TYPE;\n /**\n * Domains to exclusively include in the search (max 5).\n * Cannot be used together with `excluded_domains`.\n */\n allowed_domains?: string[];\n /**\n * Domains to exclude from the search (max 5).\n * Cannot be used together with `allowed_domains`.\n */\n excluded_domains?: string[];\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images encountered during search.\n */\n enable_image_understanding?: boolean;\n}\n\n/**\n * Options for the xAI web search tool (camelCase).\n * All fields are camel-cased for the TypeScript API and are mapped to the\n * corresponding snake_case fields in the API request.\n */\nexport interface XAIWebSearchToolOptions {\n /**\n * Domains to exclusively include in the search (max 5).\n * Cannot be used together with `excludedDomains`.\n *\n * @example [\"wikipedia.org\", \"github.com\"]\n */\n allowedDomains?: string[];\n /**\n * Domains to exclude from the search (max 5).\n * Cannot be used together with `allowedDomains`.\n *\n * @example [\"example.com\"]\n */\n excludedDomains?: string[];\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images encountered during search.\n * Note: This increases token usage as images are processed.\n *\n * @default false\n */\n enableImageUnderstanding?: boolean;\n}\n\n/**\n * Creates an xAI web search tool.\n * Enables the model to search the web and browse pages for real-time information.\n *\n * This tool is executed server-side by the xAI API as part of the agentic\n * tool calling workflow.\n *\n * @param options - Configuration options for the web search tool\n * @returns An XAIWebSearchTool object to pass to the model\n *\n * @example Basic usage\n * ```typescript\n * import { ChatXAIResponses, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAIResponses({\n * model: \"grok-4-1-fast\",\n * });\n *\n * const webSearch = tools.xaiWebSearch();\n * const result = await llm.invoke(\"What are the latest AI developments?\", {\n * tools: [webSearch],\n * });\n * ```\n *\n * @example With domain filtering\n * ```typescript\n * const webSearch = tools.xaiWebSearch({\n * allowedDomains: [\"wikipedia.org\", \"arxiv.org\"],\n * enableImageUnderstanding: true,\n * });\n * ```\n *\n * @example Excluding specific domains\n * ```typescript\n * const webSearch = tools.xaiWebSearch({\n * excludedDomains: [\"example.com\"],\n * });\n * ```\n */\nexport function xaiWebSearch(\n options: XAIWebSearchToolOptions = {}\n): XAIWebSearchTool {\n const tool: XAIWebSearchTool = {\n type: XAI_WEB_SEARCH_TOOL_TYPE,\n };\n\n if (options.allowedDomains !== undefined) {\n tool.allowed_domains = options.allowedDomains;\n }\n\n if (options.excludedDomains !== undefined) {\n tool.excluded_domains = options.excludedDomains;\n }\n\n if (options.enableImageUnderstanding !== undefined) {\n tool.enable_image_understanding = options.enableImageUnderstanding;\n }\n\n return tool;\n}\n"],"mappings":";;;;AAGA,MAAa,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGxC,SAAgB,aACdA,UAAmC,CAAE,GACnB;CAClB,MAAMC,OAAyB,EAC7B,MAAM,yBACP;AAED,KAAI,QAAQ,mBAAmB,QAC7B,KAAK,kBAAkB,QAAQ;AAGjC,KAAI,QAAQ,oBAAoB,QAC9B,KAAK,mBAAmB,QAAQ;AAGlC,KAAI,QAAQ,6BAA6B,QACvC,KAAK,6BAA6B,QAAQ;AAG5C,QAAO;AACR"}
@@ -0,0 +1,63 @@
1
+
2
+ //#region src/tools/x_search.ts
3
+ /**
4
+ * xAI X Search tool type constant.
5
+ */
6
+ const XAI_X_SEARCH_TOOL_TYPE = "x_search";
7
+ /**
8
+ * Creates an xAI X search tool.
9
+ * Enables the model to perform keyword search, semantic search, user search,
10
+ * and thread fetch on X (formerly Twitter).
11
+ *
12
+ * This tool is executed server-side by the xAI API as part of the agentic
13
+ * tool calling workflow.
14
+ *
15
+ * @param options - Configuration options for the X search tool
16
+ * @returns An XAIXSearchTool object to pass to the model
17
+ *
18
+ * @example Basic usage
19
+ * ```typescript
20
+ * import { ChatXAIResponses, tools } from "@langchain/xai";
21
+ *
22
+ * const llm = new ChatXAIResponses({
23
+ * model: "grok-4-1-fast",
24
+ * });
25
+ *
26
+ * const xSearch = tools.xaiXSearch();
27
+ * const result = await llm.invoke("What is the current status of xAI?", {
28
+ * tools: [xSearch],
29
+ * });
30
+ * ```
31
+ *
32
+ * @example With handle filtering
33
+ * ```typescript
34
+ * const xSearch = tools.xaiXSearch({
35
+ * allowedXHandles: ["elonmusk", "xai"],
36
+ * enableImageUnderstanding: true,
37
+ * });
38
+ * ```
39
+ *
40
+ * @example With date range
41
+ * ```typescript
42
+ * const xSearch = tools.xaiXSearch({
43
+ * fromDate: "2024-10-01",
44
+ * toDate: "2024-10-31",
45
+ * enableVideoUnderstanding: true,
46
+ * });
47
+ * ```
48
+ */
49
+ function xaiXSearch(options = {}) {
50
+ const tool = { type: XAI_X_SEARCH_TOOL_TYPE };
51
+ if (options.allowedXHandles !== void 0) tool.allowed_x_handles = options.allowedXHandles;
52
+ if (options.excludedXHandles !== void 0) tool.excluded_x_handles = options.excludedXHandles;
53
+ if (options.fromDate !== void 0) tool.from_date = options.fromDate;
54
+ if (options.toDate !== void 0) tool.to_date = options.toDate;
55
+ if (options.enableImageUnderstanding !== void 0) tool.enable_image_understanding = options.enableImageUnderstanding;
56
+ if (options.enableVideoUnderstanding !== void 0) tool.enable_video_understanding = options.enableVideoUnderstanding;
57
+ return tool;
58
+ }
59
+
60
+ //#endregion
61
+ exports.XAI_X_SEARCH_TOOL_TYPE = XAI_X_SEARCH_TOOL_TYPE;
62
+ exports.xaiXSearch = xaiXSearch;
63
+ //# sourceMappingURL=x_search.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x_search.cjs","names":["options: XAIXSearchToolOptions","tool: XAIXSearchTool"],"sources":["../../src/tools/x_search.ts"],"sourcesContent":["/**\n * xAI X Search tool type constant.\n */\nexport const XAI_X_SEARCH_TOOL_TYPE = \"x_search\";\n\n/**\n * xAI's built-in X (formerly Twitter) search tool interface.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X.\n *\n * This tool is part of xAI's agentic tool calling API.\n */\nexport interface XAIXSearchTool {\n /**\n * The type of the tool. Must be \"x_search\".\n */\n type: typeof XAI_X_SEARCH_TOOL_TYPE;\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excluded_x_handles`.\n */\n allowed_x_handles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowed_x_handles`.\n */\n excluded_x_handles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n */\n from_date?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n */\n to_date?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n */\n enable_image_understanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n */\n enable_video_understanding?: boolean;\n}\n\n/**\n * Options for the xAI X search tool (camelCase).\n * All fields are camel-cased for the TypeScript API and are mapped to the\n * corresponding snake_case fields in the API request.\n */\nexport interface XAIXSearchToolOptions {\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excludedXHandles`.\n *\n * @example [\"elonmusk\", \"xai\"]\n */\n allowedXHandles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowedXHandles`.\n *\n * @example [\"spamaccount\"]\n */\n excludedXHandles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n *\n * @example \"2024-01-01\"\n */\n fromDate?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n *\n * @example \"2024-12-31\"\n */\n toDate?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n * Note: This increases token usage as images are processed.\n *\n * @default false\n */\n enableImageUnderstanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n * Note: This increases token usage as video content is processed.\n *\n * @default false\n */\n enableVideoUnderstanding?: boolean;\n}\n\n/**\n * Creates an xAI X search tool.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X (formerly Twitter).\n *\n * This tool is executed server-side by the xAI API as part of the agentic\n * tool calling workflow.\n *\n * @param options - Configuration options for the X search tool\n * @returns An XAIXSearchTool object to pass to the model\n *\n * @example Basic usage\n * ```typescript\n * import { ChatXAIResponses, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAIResponses({\n * model: \"grok-4-1-fast\",\n * });\n *\n * const xSearch = tools.xaiXSearch();\n * const result = await llm.invoke(\"What is the current status of xAI?\", {\n * tools: [xSearch],\n * });\n * ```\n *\n * @example With handle filtering\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * allowedXHandles: [\"elonmusk\", \"xai\"],\n * enableImageUnderstanding: true,\n * });\n * ```\n *\n * @example With date range\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * fromDate: \"2024-10-01\",\n * toDate: \"2024-10-31\",\n * enableVideoUnderstanding: true,\n * });\n * ```\n */\nexport function xaiXSearch(\n options: XAIXSearchToolOptions = {}\n): XAIXSearchTool {\n const tool: XAIXSearchTool = {\n type: XAI_X_SEARCH_TOOL_TYPE,\n };\n\n if (options.allowedXHandles !== undefined) {\n tool.allowed_x_handles = options.allowedXHandles;\n }\n\n if (options.excludedXHandles !== undefined) {\n tool.excluded_x_handles = options.excludedXHandles;\n }\n\n if (options.fromDate !== undefined) {\n tool.from_date = options.fromDate;\n }\n\n if (options.toDate !== undefined) {\n tool.to_date = options.toDate;\n }\n\n if (options.enableImageUnderstanding !== undefined) {\n tool.enable_image_understanding = options.enableImageUnderstanding;\n }\n\n if (options.enableVideoUnderstanding !== undefined) {\n tool.enable_video_understanding = options.enableVideoUnderstanding;\n }\n\n return tool;\n}\n"],"mappings":";;;;;AAGA,MAAa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4ItC,SAAgB,WACdA,UAAiC,CAAE,GACnB;CAChB,MAAMC,OAAuB,EAC3B,MAAM,uBACP;AAED,KAAI,QAAQ,oBAAoB,QAC9B,KAAK,oBAAoB,QAAQ;AAGnC,KAAI,QAAQ,qBAAqB,QAC/B,KAAK,qBAAqB,QAAQ;AAGpC,KAAI,QAAQ,aAAa,QACvB,KAAK,YAAY,QAAQ;AAG3B,KAAI,QAAQ,WAAW,QACrB,KAAK,UAAU,QAAQ;AAGzB,KAAI,QAAQ,6BAA6B,QACvC,KAAK,6BAA6B,QAAQ;AAG5C,KAAI,QAAQ,6BAA6B,QACvC,KAAK,6BAA6B,QAAQ;AAG5C,QAAO;AACR"}
@@ -0,0 +1,145 @@
1
+ //#region src/tools/x_search.d.ts
2
+ /**
3
+ * xAI X Search tool type constant.
4
+ */
5
+ declare const XAI_X_SEARCH_TOOL_TYPE = "x_search";
6
+ /**
7
+ * xAI's built-in X (formerly Twitter) search tool interface.
8
+ * Enables the model to perform keyword search, semantic search, user search,
9
+ * and thread fetch on X.
10
+ *
11
+ * This tool is part of xAI's agentic tool calling API.
12
+ */
13
+ interface XAIXSearchTool {
14
+ /**
15
+ * The type of the tool. Must be "x_search".
16
+ */
17
+ type: typeof XAI_X_SEARCH_TOOL_TYPE;
18
+ /**
19
+ * X handles to exclusively include in the search (max 10).
20
+ * Cannot be used together with `excluded_x_handles`.
21
+ */
22
+ allowed_x_handles?: string[];
23
+ /**
24
+ * X handles to exclude from the search (max 10).
25
+ * Cannot be used together with `allowed_x_handles`.
26
+ */
27
+ excluded_x_handles?: string[];
28
+ /**
29
+ * Start date for search results (ISO-8601 format: "YYYY-MM-DD").
30
+ * Only posts from this date onwards will be included.
31
+ */
32
+ from_date?: string;
33
+ /**
34
+ * End date for search results (ISO-8601 format: "YYYY-MM-DD").
35
+ * Only posts up to this date will be included.
36
+ */
37
+ to_date?: string;
38
+ /**
39
+ * Whether to enable image understanding.
40
+ * When enabled, the model can analyze images in X posts.
41
+ */
42
+ enable_image_understanding?: boolean;
43
+ /**
44
+ * Whether to enable video understanding.
45
+ * When enabled, the model can analyze videos in X posts.
46
+ */
47
+ enable_video_understanding?: boolean;
48
+ }
49
+ /**
50
+ * Options for the xAI X search tool (camelCase).
51
+ * All fields are camel-cased for the TypeScript API and are mapped to the
52
+ * corresponding snake_case fields in the API request.
53
+ */
54
+ interface XAIXSearchToolOptions {
55
+ /**
56
+ * X handles to exclusively include in the search (max 10).
57
+ * Cannot be used together with `excludedXHandles`.
58
+ *
59
+ * @example ["elonmusk", "xai"]
60
+ */
61
+ allowedXHandles?: string[];
62
+ /**
63
+ * X handles to exclude from the search (max 10).
64
+ * Cannot be used together with `allowedXHandles`.
65
+ *
66
+ * @example ["spamaccount"]
67
+ */
68
+ excludedXHandles?: string[];
69
+ /**
70
+ * Start date for search results (ISO-8601 format: "YYYY-MM-DD").
71
+ * Only posts from this date onwards will be included.
72
+ *
73
+ * @example "2024-01-01"
74
+ */
75
+ fromDate?: string;
76
+ /**
77
+ * End date for search results (ISO-8601 format: "YYYY-MM-DD").
78
+ * Only posts up to this date will be included.
79
+ *
80
+ * @example "2024-12-31"
81
+ */
82
+ toDate?: string;
83
+ /**
84
+ * Whether to enable image understanding.
85
+ * When enabled, the model can analyze images in X posts.
86
+ * Note: This increases token usage as images are processed.
87
+ *
88
+ * @default false
89
+ */
90
+ enableImageUnderstanding?: boolean;
91
+ /**
92
+ * Whether to enable video understanding.
93
+ * When enabled, the model can analyze videos in X posts.
94
+ * Note: This increases token usage as video content is processed.
95
+ *
96
+ * @default false
97
+ */
98
+ enableVideoUnderstanding?: boolean;
99
+ }
100
+ /**
101
+ * Creates an xAI X search tool.
102
+ * Enables the model to perform keyword search, semantic search, user search,
103
+ * and thread fetch on X (formerly Twitter).
104
+ *
105
+ * This tool is executed server-side by the xAI API as part of the agentic
106
+ * tool calling workflow.
107
+ *
108
+ * @param options - Configuration options for the X search tool
109
+ * @returns An XAIXSearchTool object to pass to the model
110
+ *
111
+ * @example Basic usage
112
+ * ```typescript
113
+ * import { ChatXAIResponses, tools } from "@langchain/xai";
114
+ *
115
+ * const llm = new ChatXAIResponses({
116
+ * model: "grok-4-1-fast",
117
+ * });
118
+ *
119
+ * const xSearch = tools.xaiXSearch();
120
+ * const result = await llm.invoke("What is the current status of xAI?", {
121
+ * tools: [xSearch],
122
+ * });
123
+ * ```
124
+ *
125
+ * @example With handle filtering
126
+ * ```typescript
127
+ * const xSearch = tools.xaiXSearch({
128
+ * allowedXHandles: ["elonmusk", "xai"],
129
+ * enableImageUnderstanding: true,
130
+ * });
131
+ * ```
132
+ *
133
+ * @example With date range
134
+ * ```typescript
135
+ * const xSearch = tools.xaiXSearch({
136
+ * fromDate: "2024-10-01",
137
+ * toDate: "2024-10-31",
138
+ * enableVideoUnderstanding: true,
139
+ * });
140
+ * ```
141
+ */
142
+ declare function xaiXSearch(options?: XAIXSearchToolOptions): XAIXSearchTool;
143
+ //#endregion
144
+ export { XAIXSearchTool, XAIXSearchToolOptions, XAI_X_SEARCH_TOOL_TYPE, xaiXSearch };
145
+ //# sourceMappingURL=x_search.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x_search.d.cts","names":["XAI_X_SEARCH_TOOL_TYPE","XAIXSearchTool","XAIXSearchToolOptions","xaiXSearch"],"sources":["../../src/tools/x_search.d.ts"],"sourcesContent":["/**\n * xAI X Search tool type constant.\n */\nexport declare const XAI_X_SEARCH_TOOL_TYPE = \"x_search\";\n/**\n * xAI's built-in X (formerly Twitter) search tool interface.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X.\n *\n * This tool is part of xAI's agentic tool calling API.\n */\nexport interface XAIXSearchTool {\n /**\n * The type of the tool. Must be \"x_search\".\n */\n type: typeof XAI_X_SEARCH_TOOL_TYPE;\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excluded_x_handles`.\n */\n allowed_x_handles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowed_x_handles`.\n */\n excluded_x_handles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n */\n from_date?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n */\n to_date?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n */\n enable_image_understanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n */\n enable_video_understanding?: boolean;\n}\n/**\n * Options for the xAI X search tool (camelCase).\n * All fields are camel-cased for the TypeScript API and are mapped to the\n * corresponding snake_case fields in the API request.\n */\nexport interface XAIXSearchToolOptions {\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excludedXHandles`.\n *\n * @example [\"elonmusk\", \"xai\"]\n */\n allowedXHandles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowedXHandles`.\n *\n * @example [\"spamaccount\"]\n */\n excludedXHandles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n *\n * @example \"2024-01-01\"\n */\n fromDate?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n *\n * @example \"2024-12-31\"\n */\n toDate?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n * Note: This increases token usage as images are processed.\n *\n * @default false\n */\n enableImageUnderstanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n * Note: This increases token usage as video content is processed.\n *\n * @default false\n */\n enableVideoUnderstanding?: boolean;\n}\n/**\n * Creates an xAI X search tool.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X (formerly Twitter).\n *\n * This tool is executed server-side by the xAI API as part of the agentic\n * tool calling workflow.\n *\n * @param options - Configuration options for the X search tool\n * @returns An XAIXSearchTool object to pass to the model\n *\n * @example Basic usage\n * ```typescript\n * import { ChatXAIResponses, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAIResponses({\n * model: \"grok-4-1-fast\",\n * });\n *\n * const xSearch = tools.xaiXSearch();\n * const result = await llm.invoke(\"What is the current status of xAI?\", {\n * tools: [xSearch],\n * });\n * ```\n *\n * @example With handle filtering\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * allowedXHandles: [\"elonmusk\", \"xai\"],\n * enableImageUnderstanding: true,\n * });\n * ```\n *\n * @example With date range\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * fromDate: \"2024-10-01\",\n * toDate: \"2024-10-31\",\n * enableVideoUnderstanding: true,\n * });\n * ```\n */\nexport declare function xaiXSearch(options?: XAIXSearchToolOptions): XAIXSearchTool;\n//# sourceMappingURL=x_search.d.ts.map"],"mappings":";;AAGA;AAQA;AAyCiBE,cAjDIF,sBAAAA,GAiDiB,UAAA;AAwFtC;;;;;;;UAjIiBC,cAAAA;;;;eAIAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAqCAE,qBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwFOC,UAAAA,WAAqBD,wBAAwBD"}
@@ -0,0 +1,145 @@
1
+ //#region src/tools/x_search.d.ts
2
+ /**
3
+ * xAI X Search tool type constant.
4
+ */
5
+ declare const XAI_X_SEARCH_TOOL_TYPE = "x_search";
6
+ /**
7
+ * xAI's built-in X (formerly Twitter) search tool interface.
8
+ * Enables the model to perform keyword search, semantic search, user search,
9
+ * and thread fetch on X.
10
+ *
11
+ * This tool is part of xAI's agentic tool calling API.
12
+ */
13
+ interface XAIXSearchTool {
14
+ /**
15
+ * The type of the tool. Must be "x_search".
16
+ */
17
+ type: typeof XAI_X_SEARCH_TOOL_TYPE;
18
+ /**
19
+ * X handles to exclusively include in the search (max 10).
20
+ * Cannot be used together with `excluded_x_handles`.
21
+ */
22
+ allowed_x_handles?: string[];
23
+ /**
24
+ * X handles to exclude from the search (max 10).
25
+ * Cannot be used together with `allowed_x_handles`.
26
+ */
27
+ excluded_x_handles?: string[];
28
+ /**
29
+ * Start date for search results (ISO-8601 format: "YYYY-MM-DD").
30
+ * Only posts from this date onwards will be included.
31
+ */
32
+ from_date?: string;
33
+ /**
34
+ * End date for search results (ISO-8601 format: "YYYY-MM-DD").
35
+ * Only posts up to this date will be included.
36
+ */
37
+ to_date?: string;
38
+ /**
39
+ * Whether to enable image understanding.
40
+ * When enabled, the model can analyze images in X posts.
41
+ */
42
+ enable_image_understanding?: boolean;
43
+ /**
44
+ * Whether to enable video understanding.
45
+ * When enabled, the model can analyze videos in X posts.
46
+ */
47
+ enable_video_understanding?: boolean;
48
+ }
49
+ /**
50
+ * Options for the xAI X search tool (camelCase).
51
+ * All fields are camel-cased for the TypeScript API and are mapped to the
52
+ * corresponding snake_case fields in the API request.
53
+ */
54
+ interface XAIXSearchToolOptions {
55
+ /**
56
+ * X handles to exclusively include in the search (max 10).
57
+ * Cannot be used together with `excludedXHandles`.
58
+ *
59
+ * @example ["elonmusk", "xai"]
60
+ */
61
+ allowedXHandles?: string[];
62
+ /**
63
+ * X handles to exclude from the search (max 10).
64
+ * Cannot be used together with `allowedXHandles`.
65
+ *
66
+ * @example ["spamaccount"]
67
+ */
68
+ excludedXHandles?: string[];
69
+ /**
70
+ * Start date for search results (ISO-8601 format: "YYYY-MM-DD").
71
+ * Only posts from this date onwards will be included.
72
+ *
73
+ * @example "2024-01-01"
74
+ */
75
+ fromDate?: string;
76
+ /**
77
+ * End date for search results (ISO-8601 format: "YYYY-MM-DD").
78
+ * Only posts up to this date will be included.
79
+ *
80
+ * @example "2024-12-31"
81
+ */
82
+ toDate?: string;
83
+ /**
84
+ * Whether to enable image understanding.
85
+ * When enabled, the model can analyze images in X posts.
86
+ * Note: This increases token usage as images are processed.
87
+ *
88
+ * @default false
89
+ */
90
+ enableImageUnderstanding?: boolean;
91
+ /**
92
+ * Whether to enable video understanding.
93
+ * When enabled, the model can analyze videos in X posts.
94
+ * Note: This increases token usage as video content is processed.
95
+ *
96
+ * @default false
97
+ */
98
+ enableVideoUnderstanding?: boolean;
99
+ }
100
+ /**
101
+ * Creates an xAI X search tool.
102
+ * Enables the model to perform keyword search, semantic search, user search,
103
+ * and thread fetch on X (formerly Twitter).
104
+ *
105
+ * This tool is executed server-side by the xAI API as part of the agentic
106
+ * tool calling workflow.
107
+ *
108
+ * @param options - Configuration options for the X search tool
109
+ * @returns An XAIXSearchTool object to pass to the model
110
+ *
111
+ * @example Basic usage
112
+ * ```typescript
113
+ * import { ChatXAIResponses, tools } from "@langchain/xai";
114
+ *
115
+ * const llm = new ChatXAIResponses({
116
+ * model: "grok-4-1-fast",
117
+ * });
118
+ *
119
+ * const xSearch = tools.xaiXSearch();
120
+ * const result = await llm.invoke("What is the current status of xAI?", {
121
+ * tools: [xSearch],
122
+ * });
123
+ * ```
124
+ *
125
+ * @example With handle filtering
126
+ * ```typescript
127
+ * const xSearch = tools.xaiXSearch({
128
+ * allowedXHandles: ["elonmusk", "xai"],
129
+ * enableImageUnderstanding: true,
130
+ * });
131
+ * ```
132
+ *
133
+ * @example With date range
134
+ * ```typescript
135
+ * const xSearch = tools.xaiXSearch({
136
+ * fromDate: "2024-10-01",
137
+ * toDate: "2024-10-31",
138
+ * enableVideoUnderstanding: true,
139
+ * });
140
+ * ```
141
+ */
142
+ declare function xaiXSearch(options?: XAIXSearchToolOptions): XAIXSearchTool;
143
+ //#endregion
144
+ export { XAIXSearchTool, XAIXSearchToolOptions, XAI_X_SEARCH_TOOL_TYPE, xaiXSearch };
145
+ //# sourceMappingURL=x_search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x_search.d.ts","names":["XAI_X_SEARCH_TOOL_TYPE","XAIXSearchTool","XAIXSearchToolOptions","xaiXSearch"],"sources":["../../src/tools/x_search.d.ts"],"sourcesContent":["/**\n * xAI X Search tool type constant.\n */\nexport declare const XAI_X_SEARCH_TOOL_TYPE = \"x_search\";\n/**\n * xAI's built-in X (formerly Twitter) search tool interface.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X.\n *\n * This tool is part of xAI's agentic tool calling API.\n */\nexport interface XAIXSearchTool {\n /**\n * The type of the tool. Must be \"x_search\".\n */\n type: typeof XAI_X_SEARCH_TOOL_TYPE;\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excluded_x_handles`.\n */\n allowed_x_handles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowed_x_handles`.\n */\n excluded_x_handles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n */\n from_date?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n */\n to_date?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n */\n enable_image_understanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n */\n enable_video_understanding?: boolean;\n}\n/**\n * Options for the xAI X search tool (camelCase).\n * All fields are camel-cased for the TypeScript API and are mapped to the\n * corresponding snake_case fields in the API request.\n */\nexport interface XAIXSearchToolOptions {\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excludedXHandles`.\n *\n * @example [\"elonmusk\", \"xai\"]\n */\n allowedXHandles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowedXHandles`.\n *\n * @example [\"spamaccount\"]\n */\n excludedXHandles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n *\n * @example \"2024-01-01\"\n */\n fromDate?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n *\n * @example \"2024-12-31\"\n */\n toDate?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n * Note: This increases token usage as images are processed.\n *\n * @default false\n */\n enableImageUnderstanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n * Note: This increases token usage as video content is processed.\n *\n * @default false\n */\n enableVideoUnderstanding?: boolean;\n}\n/**\n * Creates an xAI X search tool.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X (formerly Twitter).\n *\n * This tool is executed server-side by the xAI API as part of the agentic\n * tool calling workflow.\n *\n * @param options - Configuration options for the X search tool\n * @returns An XAIXSearchTool object to pass to the model\n *\n * @example Basic usage\n * ```typescript\n * import { ChatXAIResponses, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAIResponses({\n * model: \"grok-4-1-fast\",\n * });\n *\n * const xSearch = tools.xaiXSearch();\n * const result = await llm.invoke(\"What is the current status of xAI?\", {\n * tools: [xSearch],\n * });\n * ```\n *\n * @example With handle filtering\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * allowedXHandles: [\"elonmusk\", \"xai\"],\n * enableImageUnderstanding: true,\n * });\n * ```\n *\n * @example With date range\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * fromDate: \"2024-10-01\",\n * toDate: \"2024-10-31\",\n * enableVideoUnderstanding: true,\n * });\n * ```\n */\nexport declare function xaiXSearch(options?: XAIXSearchToolOptions): XAIXSearchTool;\n//# sourceMappingURL=x_search.d.ts.map"],"mappings":";;AAGA;AAQA;AAyCiBE,cAjDIF,sBAAAA,GAiDiB,UAAA;AAwFtC;;;;;;;UAjIiBC,cAAAA;;;;eAIAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAqCAE,qBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwFOC,UAAAA,WAAqBD,wBAAwBD"}
@@ -0,0 +1,61 @@
1
+ //#region src/tools/x_search.ts
2
+ /**
3
+ * xAI X Search tool type constant.
4
+ */
5
+ const XAI_X_SEARCH_TOOL_TYPE = "x_search";
6
+ /**
7
+ * Creates an xAI X search tool.
8
+ * Enables the model to perform keyword search, semantic search, user search,
9
+ * and thread fetch on X (formerly Twitter).
10
+ *
11
+ * This tool is executed server-side by the xAI API as part of the agentic
12
+ * tool calling workflow.
13
+ *
14
+ * @param options - Configuration options for the X search tool
15
+ * @returns An XAIXSearchTool object to pass to the model
16
+ *
17
+ * @example Basic usage
18
+ * ```typescript
19
+ * import { ChatXAIResponses, tools } from "@langchain/xai";
20
+ *
21
+ * const llm = new ChatXAIResponses({
22
+ * model: "grok-4-1-fast",
23
+ * });
24
+ *
25
+ * const xSearch = tools.xaiXSearch();
26
+ * const result = await llm.invoke("What is the current status of xAI?", {
27
+ * tools: [xSearch],
28
+ * });
29
+ * ```
30
+ *
31
+ * @example With handle filtering
32
+ * ```typescript
33
+ * const xSearch = tools.xaiXSearch({
34
+ * allowedXHandles: ["elonmusk", "xai"],
35
+ * enableImageUnderstanding: true,
36
+ * });
37
+ * ```
38
+ *
39
+ * @example With date range
40
+ * ```typescript
41
+ * const xSearch = tools.xaiXSearch({
42
+ * fromDate: "2024-10-01",
43
+ * toDate: "2024-10-31",
44
+ * enableVideoUnderstanding: true,
45
+ * });
46
+ * ```
47
+ */
48
+ function xaiXSearch(options = {}) {
49
+ const tool = { type: XAI_X_SEARCH_TOOL_TYPE };
50
+ if (options.allowedXHandles !== void 0) tool.allowed_x_handles = options.allowedXHandles;
51
+ if (options.excludedXHandles !== void 0) tool.excluded_x_handles = options.excludedXHandles;
52
+ if (options.fromDate !== void 0) tool.from_date = options.fromDate;
53
+ if (options.toDate !== void 0) tool.to_date = options.toDate;
54
+ if (options.enableImageUnderstanding !== void 0) tool.enable_image_understanding = options.enableImageUnderstanding;
55
+ if (options.enableVideoUnderstanding !== void 0) tool.enable_video_understanding = options.enableVideoUnderstanding;
56
+ return tool;
57
+ }
58
+
59
+ //#endregion
60
+ export { XAI_X_SEARCH_TOOL_TYPE, xaiXSearch };
61
+ //# sourceMappingURL=x_search.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"x_search.js","names":["options: XAIXSearchToolOptions","tool: XAIXSearchTool"],"sources":["../../src/tools/x_search.ts"],"sourcesContent":["/**\n * xAI X Search tool type constant.\n */\nexport const XAI_X_SEARCH_TOOL_TYPE = \"x_search\";\n\n/**\n * xAI's built-in X (formerly Twitter) search tool interface.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X.\n *\n * This tool is part of xAI's agentic tool calling API.\n */\nexport interface XAIXSearchTool {\n /**\n * The type of the tool. Must be \"x_search\".\n */\n type: typeof XAI_X_SEARCH_TOOL_TYPE;\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excluded_x_handles`.\n */\n allowed_x_handles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowed_x_handles`.\n */\n excluded_x_handles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n */\n from_date?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n */\n to_date?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n */\n enable_image_understanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n */\n enable_video_understanding?: boolean;\n}\n\n/**\n * Options for the xAI X search tool (camelCase).\n * All fields are camel-cased for the TypeScript API and are mapped to the\n * corresponding snake_case fields in the API request.\n */\nexport interface XAIXSearchToolOptions {\n /**\n * X handles to exclusively include in the search (max 10).\n * Cannot be used together with `excludedXHandles`.\n *\n * @example [\"elonmusk\", \"xai\"]\n */\n allowedXHandles?: string[];\n /**\n * X handles to exclude from the search (max 10).\n * Cannot be used together with `allowedXHandles`.\n *\n * @example [\"spamaccount\"]\n */\n excludedXHandles?: string[];\n /**\n * Start date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts from this date onwards will be included.\n *\n * @example \"2024-01-01\"\n */\n fromDate?: string;\n /**\n * End date for search results (ISO-8601 format: \"YYYY-MM-DD\").\n * Only posts up to this date will be included.\n *\n * @example \"2024-12-31\"\n */\n toDate?: string;\n /**\n * Whether to enable image understanding.\n * When enabled, the model can analyze images in X posts.\n * Note: This increases token usage as images are processed.\n *\n * @default false\n */\n enableImageUnderstanding?: boolean;\n /**\n * Whether to enable video understanding.\n * When enabled, the model can analyze videos in X posts.\n * Note: This increases token usage as video content is processed.\n *\n * @default false\n */\n enableVideoUnderstanding?: boolean;\n}\n\n/**\n * Creates an xAI X search tool.\n * Enables the model to perform keyword search, semantic search, user search,\n * and thread fetch on X (formerly Twitter).\n *\n * This tool is executed server-side by the xAI API as part of the agentic\n * tool calling workflow.\n *\n * @param options - Configuration options for the X search tool\n * @returns An XAIXSearchTool object to pass to the model\n *\n * @example Basic usage\n * ```typescript\n * import { ChatXAIResponses, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAIResponses({\n * model: \"grok-4-1-fast\",\n * });\n *\n * const xSearch = tools.xaiXSearch();\n * const result = await llm.invoke(\"What is the current status of xAI?\", {\n * tools: [xSearch],\n * });\n * ```\n *\n * @example With handle filtering\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * allowedXHandles: [\"elonmusk\", \"xai\"],\n * enableImageUnderstanding: true,\n * });\n * ```\n *\n * @example With date range\n * ```typescript\n * const xSearch = tools.xaiXSearch({\n * fromDate: \"2024-10-01\",\n * toDate: \"2024-10-31\",\n * enableVideoUnderstanding: true,\n * });\n * ```\n */\nexport function xaiXSearch(\n options: XAIXSearchToolOptions = {}\n): XAIXSearchTool {\n const tool: XAIXSearchTool = {\n type: XAI_X_SEARCH_TOOL_TYPE,\n };\n\n if (options.allowedXHandles !== undefined) {\n tool.allowed_x_handles = options.allowedXHandles;\n }\n\n if (options.excludedXHandles !== undefined) {\n tool.excluded_x_handles = options.excludedXHandles;\n }\n\n if (options.fromDate !== undefined) {\n tool.from_date = options.fromDate;\n }\n\n if (options.toDate !== undefined) {\n tool.to_date = options.toDate;\n }\n\n if (options.enableImageUnderstanding !== undefined) {\n tool.enable_image_understanding = options.enableImageUnderstanding;\n }\n\n if (options.enableVideoUnderstanding !== undefined) {\n tool.enable_video_understanding = options.enableVideoUnderstanding;\n }\n\n return tool;\n}\n"],"mappings":";;;;AAGA,MAAa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4ItC,SAAgB,WACdA,UAAiC,CAAE,GACnB;CAChB,MAAMC,OAAuB,EAC3B,MAAM,uBACP;AAED,KAAI,QAAQ,oBAAoB,QAC9B,KAAK,oBAAoB,QAAQ;AAGnC,KAAI,QAAQ,qBAAqB,QAC/B,KAAK,qBAAqB,QAAQ;AAGpC,KAAI,QAAQ,aAAa,QACvB,KAAK,YAAY,QAAQ;AAG3B,KAAI,QAAQ,WAAW,QACrB,KAAK,UAAU,QAAQ;AAGzB,KAAI,QAAQ,6BAA6B,QACvC,KAAK,6BAA6B,QAAQ;AAG5C,KAAI,QAAQ,6BAA6B,QACvC,KAAK,6BAA6B,QAAQ;AAG5C,QAAO;AACR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/xai",
3
- "version": "1.2.2",
3
+ "version": "1.3.1",
4
4
  "description": "xAI integration for LangChain.js",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -14,7 +14,7 @@
14
14
  },
15
15
  "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-xai/",
16
16
  "dependencies": {
17
- "@langchain/openai": "1.2.3"
17
+ "@langchain/openai": "1.2.5"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@langchain/core": "^1.0.0"
@@ -30,10 +30,10 @@
30
30
  "typescript": "~5.8.3",
31
31
  "vitest": "^3.2.4",
32
32
  "zod": "^3.25.76",
33
+ "@langchain/core": "1.1.19",
33
34
  "@langchain/eslint": "0.1.1",
34
- "@langchain/openai": "^1.2.3",
35
- "@langchain/standard-tests": "0.0.19",
36
- "@langchain/core": "1.1.16",
35
+ "@langchain/openai": "^1.2.5",
36
+ "@langchain/standard-tests": "0.0.22",
37
37
  "@langchain/tsconfig": "0.0.1"
38
38
  },
39
39
  "publishConfig": {