@langchain/xai 1.3.3 → 1.3.4

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 (67) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/chat_models/completions.cjs +9 -11
  3. package/dist/chat_models/completions.cjs.map +1 -1
  4. package/dist/chat_models/completions.d.cts.map +1 -1
  5. package/dist/chat_models/completions.d.ts.map +1 -1
  6. package/dist/chat_models/completions.js +4 -5
  7. package/dist/chat_models/completions.js.map +1 -1
  8. package/dist/chat_models/index.js +2 -0
  9. package/dist/chat_models/responses-types.d.cts +5 -12
  10. package/dist/chat_models/responses-types.d.cts.map +1 -1
  11. package/dist/chat_models/responses-types.d.ts +5 -12
  12. package/dist/chat_models/responses-types.d.ts.map +1 -1
  13. package/dist/chat_models/responses.cjs +9 -14
  14. package/dist/chat_models/responses.cjs.map +1 -1
  15. package/dist/chat_models/responses.d.cts +0 -1
  16. package/dist/chat_models/responses.d.cts.map +1 -1
  17. package/dist/chat_models/responses.d.ts +0 -1
  18. package/dist/chat_models/responses.d.ts.map +1 -1
  19. package/dist/chat_models/responses.js +5 -9
  20. package/dist/chat_models/responses.js.map +1 -1
  21. package/dist/converters/responses.cjs +15 -20
  22. package/dist/converters/responses.cjs.map +1 -1
  23. package/dist/converters/responses.js +6 -10
  24. package/dist/converters/responses.js.map +1 -1
  25. package/dist/index.cjs +1 -0
  26. package/dist/live_search.cjs +3 -3
  27. package/dist/live_search.cjs.map +1 -1
  28. package/dist/live_search.d.cts.map +1 -1
  29. package/dist/live_search.d.ts.map +1 -1
  30. package/dist/live_search.js +3 -3
  31. package/dist/live_search.js.map +1 -1
  32. package/dist/profiles.cjs +86 -59
  33. package/dist/profiles.cjs.map +1 -1
  34. package/dist/profiles.js +86 -59
  35. package/dist/profiles.js.map +1 -1
  36. package/dist/tools/code_execution.cjs.map +1 -1
  37. package/dist/tools/code_execution.d.cts.map +1 -1
  38. package/dist/tools/code_execution.d.ts.map +1 -1
  39. package/dist/tools/code_execution.js.map +1 -1
  40. package/dist/tools/collections_search.cjs.map +1 -1
  41. package/dist/tools/collections_search.d.cts.map +1 -1
  42. package/dist/tools/collections_search.d.ts.map +1 -1
  43. package/dist/tools/collections_search.js.map +1 -1
  44. package/dist/tools/index.cjs.map +1 -1
  45. package/dist/tools/index.d.cts +1 -2
  46. package/dist/tools/index.d.cts.map +1 -1
  47. package/dist/tools/index.d.ts +1 -2
  48. package/dist/tools/index.d.ts.map +1 -1
  49. package/dist/tools/index.js.map +1 -1
  50. package/dist/tools/live_search.cjs +1 -4
  51. package/dist/tools/live_search.cjs.map +1 -1
  52. package/dist/tools/live_search.d.cts +0 -1
  53. package/dist/tools/live_search.d.cts.map +1 -1
  54. package/dist/tools/live_search.d.ts +0 -1
  55. package/dist/tools/live_search.d.ts.map +1 -1
  56. package/dist/tools/live_search.js +1 -4
  57. package/dist/tools/live_search.js.map +1 -1
  58. package/dist/tools/web_search.cjs.map +1 -1
  59. package/dist/tools/web_search.d.cts.map +1 -1
  60. package/dist/tools/web_search.d.ts.map +1 -1
  61. package/dist/tools/web_search.js.map +1 -1
  62. package/dist/tools/x_search.cjs.map +1 -1
  63. package/dist/tools/x_search.d.cts.map +1 -1
  64. package/dist/tools/x_search.d.ts.map +1 -1
  65. package/dist/tools/x_search.js.map +1 -1
  66. package/package.json +6 -6
  67. package/dist/_virtual/rolldown_runtime.cjs +0 -25
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.js","names":["PROFILES: Record<string, ModelProfile>"],"sources":["../src/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"grok-4-fast-non-reasoning\": {\n maxInputTokens: 2000000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 30000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-fast\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-4\": {\n maxInputTokens: 256000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-vision\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-code-fast-1\": {\n maxInputTokens: 256000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 10000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini-fast-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-vision-1212\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-4-fast\": {\n maxInputTokens: 2000000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 30000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-1212\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-fast-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-vision-latest\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-vision-beta\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-beta\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini-fast\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAMA,WAAyC;CAC7C,6BAA6B;EAC3B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,UAAU;EACR,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,iBAAiB;EACf,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,UAAU;EACR,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,2BAA2B;EACzB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,sBAAsB;EACpB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,UAAU;EACR,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,iBAAiB;EACf,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,sBAAsB;EACpB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,iBAAiB;EACf,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,aAAa;EACX,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,sBAAsB;EACpB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;CACnB;AACF;AACD,uBAAe"}
1
+ {"version":3,"file":"profiles.js","names":[],"sources":["../src/profiles.ts"],"sourcesContent":["/**\n * This file was automatically generated by an automated script. Do not edit manually.\n */\nimport type { ModelProfile } from \"@langchain/core/language_models/profile\";\nconst PROFILES: Record<string, ModelProfile> = {\n \"grok-2-1212\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-fast-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-vision\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-code-fast-1\": {\n maxInputTokens: 256000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 10000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-vision-1212\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-4-1-fast-non-reasoning\": {\n maxInputTokens: 2000000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 30000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-beta\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini-fast\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-4-fast\": {\n maxInputTokens: 2000000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 30000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-4\": {\n maxInputTokens: 256000,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 64000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-4-1-fast\": {\n maxInputTokens: 2000000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 30000,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-vision-latest\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-mini-fast-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: true,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-2-latest\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-4-fast-non-reasoning\": {\n maxInputTokens: 2000000,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 30000,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-vision-beta\": {\n maxInputTokens: 8192,\n imageInputs: true,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 4096,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n \"grok-3-fast\": {\n maxInputTokens: 131072,\n imageInputs: false,\n audioInputs: false,\n pdfInputs: false,\n videoInputs: false,\n maxOutputTokens: 8192,\n reasoningOutput: false,\n imageOutputs: false,\n audioOutputs: false,\n videoOutputs: false,\n toolCalling: true,\n structuredOutput: false,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAM,WAAyC;CAC7C,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,UAAU;EACR,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,sBAAsB;EACpB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,iBAAiB;EACf,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,UAAU;EACR,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,sBAAsB;EACpB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,+BAA+B;EAC7B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,aAAa;EACX,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,UAAU;EACR,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,iBAAiB;EACf,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,iBAAiB;EACf,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,wBAAwB;EACtB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,sBAAsB;EACpB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,2BAA2B;EACzB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,iBAAiB;EACf,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,6BAA6B;EAC3B,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,oBAAoB;EAClB,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACD,eAAe;EACb,gBAAgB;EAChB,aAAa;EACb,aAAa;EACb,WAAW;EACX,aAAa;EACb,iBAAiB;EACjB,iBAAiB;EACjB,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa;EACb,kBAAkB;EACnB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"code_execution.cjs","names":[],"sources":["../../src/tools/code_execution.ts"],"sourcesContent":["/**\n * xAI Code Execution tool type constant.\n * Note: The Responses API uses \"code_interpreter\" as the type name.\n */\nexport const XAI_CODE_EXECUTION_TOOL_TYPE = \"code_interpreter\";\n\n/**\n * xAI's built-in code execution tool interface.\n * Enables the model to write and execute Python code in real-time.\n *\n * This tool is part of xAI's agentic tool calling API and allows for:\n * - Mathematical computations\n * - Data analysis\n * - Financial modeling\n * - Scientific computing\n * - Code generation and testing\n */\nexport interface XAICodeExecutionTool {\n /**\n * The type of the tool. Must be \"code_interpreter\".\n */\n type: typeof XAI_CODE_EXECUTION_TOOL_TYPE;\n}\n\n/**\n * Creates an xAI code execution tool.\n * Enables the model to write and execute Python code in real-time for\n * calculations, data analysis, and complex computations.\n *\n * This tool is executed server-side by the xAI API in a secure, sandboxed\n * Python environment with common libraries pre-installed (NumPy, Pandas,\n * Matplotlib, SciPy).\n *\n * @returns An XAICodeExecutionTool 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 codeExecution = tools.xaiCodeExecution();\n * const result = await llm.invoke(\n * \"Calculate the compound interest for $10,000 at 5% annually for 10 years\",\n * { tools: [codeExecution] }\n * );\n * ```\n *\n * @example Combining with search tools\n * ```typescript\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Find the current stock price of AAPL and calculate what it would be worth with 10% annual growth over 5 years\",\n * { tools: [webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCodeExecution(): XAICodeExecutionTool {\n return {\n type: XAI_CODE_EXECUTION_TOOL_TYPE,\n };\n}\n"],"mappings":";;;;;;AAIA,MAAa,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyD5C,SAAgB,mBAAyC;AACvD,QAAO,EACL,MAAM,6BACP;AACF"}
1
+ {"version":3,"file":"code_execution.cjs","names":[],"sources":["../../src/tools/code_execution.ts"],"sourcesContent":["/**\n * xAI Code Execution tool type constant.\n * Note: The Responses API uses \"code_interpreter\" as the type name.\n */\nexport const XAI_CODE_EXECUTION_TOOL_TYPE = \"code_interpreter\";\n\n/**\n * xAI's built-in code execution tool interface.\n * Enables the model to write and execute Python code in real-time.\n *\n * This tool is part of xAI's agentic tool calling API and allows for:\n * - Mathematical computations\n * - Data analysis\n * - Financial modeling\n * - Scientific computing\n * - Code generation and testing\n */\nexport interface XAICodeExecutionTool {\n /**\n * The type of the tool. Must be \"code_interpreter\".\n */\n type: typeof XAI_CODE_EXECUTION_TOOL_TYPE;\n}\n\n/**\n * Creates an xAI code execution tool.\n * Enables the model to write and execute Python code in real-time for\n * calculations, data analysis, and complex computations.\n *\n * This tool is executed server-side by the xAI API in a secure, sandboxed\n * Python environment with common libraries pre-installed (NumPy, Pandas,\n * Matplotlib, SciPy).\n *\n * @returns An XAICodeExecutionTool 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 codeExecution = tools.xaiCodeExecution();\n * const result = await llm.invoke(\n * \"Calculate the compound interest for $10,000 at 5% annually for 10 years\",\n * { tools: [codeExecution] }\n * );\n * ```\n *\n * @example Combining with search tools\n * ```typescript\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Find the current stock price of AAPL and calculate what it would be worth with 10% annual growth over 5 years\",\n * { tools: [webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCodeExecution(): XAICodeExecutionTool {\n return {\n type: XAI_CODE_EXECUTION_TOOL_TYPE,\n };\n}\n"],"mappings":";;;;;;AAIA,MAAa,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyD5C,SAAgB,mBAAyC;AACvD,QAAO,EACL,MAAM,8BACP"}
@@ -1 +1 @@
1
- {"version":3,"file":"code_execution.d.cts","names":["XAI_CODE_EXECUTION_TOOL_TYPE","XAICodeExecutionTool","xaiCodeExecution"],"sources":["../../src/tools/code_execution.d.ts"],"sourcesContent":["/**\n * xAI Code Execution tool type constant.\n * Note: The Responses API uses \"code_interpreter\" as the type name.\n */\nexport declare const XAI_CODE_EXECUTION_TOOL_TYPE = \"code_interpreter\";\n/**\n * xAI's built-in code execution tool interface.\n * Enables the model to write and execute Python code in real-time.\n *\n * This tool is part of xAI's agentic tool calling API and allows for:\n * - Mathematical computations\n * - Data analysis\n * - Financial modeling\n * - Scientific computing\n * - Code generation and testing\n */\nexport interface XAICodeExecutionTool {\n /**\n * The type of the tool. Must be \"code_interpreter\".\n */\n type: typeof XAI_CODE_EXECUTION_TOOL_TYPE;\n}\n/**\n * Creates an xAI code execution tool.\n * Enables the model to write and execute Python code in real-time for\n * calculations, data analysis, and complex computations.\n *\n * This tool is executed server-side by the xAI API in a secure, sandboxed\n * Python environment with common libraries pre-installed (NumPy, Pandas,\n * Matplotlib, SciPy).\n *\n * @returns An XAICodeExecutionTool 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 codeExecution = tools.xaiCodeExecution();\n * const result = await llm.invoke(\n * \"Calculate the compound interest for $10,000 at 5% annually for 10 years\",\n * { tools: [codeExecution] }\n * );\n * ```\n *\n * @example Combining with search tools\n * ```typescript\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Find the current stock price of AAPL and calculate what it would be worth with 10% annual growth over 5 years\",\n * { tools: [webSearch, codeExecution] }\n * );\n * ```\n */\nexport declare function xaiCodeExecution(): XAICodeExecutionTool;\n//# sourceMappingURL=code_execution.d.ts.map"],"mappings":";;AAIA;AAYA;AA2CA;cAvDqBA,4BAAAA;;;;;;;;;;;;UAYJC,oBAAAA;;;;eAIAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCOE,gBAAAA,CAAAA,GAAoBD"}
1
+ {"version":3,"file":"code_execution.d.cts","names":[],"sources":["../../src/tools/code_execution.ts"],"mappings":";;AAIA;;;cAAa,4BAAA;;AAab;;;;;AA4CA;;;;;UA5CiB,oBAAA;;;;EAIf,IAAA,SAAa,4BAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCC,gBAAA,CAAA,GAAoB,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"code_execution.d.ts","names":["XAI_CODE_EXECUTION_TOOL_TYPE","XAICodeExecutionTool","xaiCodeExecution"],"sources":["../../src/tools/code_execution.d.ts"],"sourcesContent":["/**\n * xAI Code Execution tool type constant.\n * Note: The Responses API uses \"code_interpreter\" as the type name.\n */\nexport declare const XAI_CODE_EXECUTION_TOOL_TYPE = \"code_interpreter\";\n/**\n * xAI's built-in code execution tool interface.\n * Enables the model to write and execute Python code in real-time.\n *\n * This tool is part of xAI's agentic tool calling API and allows for:\n * - Mathematical computations\n * - Data analysis\n * - Financial modeling\n * - Scientific computing\n * - Code generation and testing\n */\nexport interface XAICodeExecutionTool {\n /**\n * The type of the tool. Must be \"code_interpreter\".\n */\n type: typeof XAI_CODE_EXECUTION_TOOL_TYPE;\n}\n/**\n * Creates an xAI code execution tool.\n * Enables the model to write and execute Python code in real-time for\n * calculations, data analysis, and complex computations.\n *\n * This tool is executed server-side by the xAI API in a secure, sandboxed\n * Python environment with common libraries pre-installed (NumPy, Pandas,\n * Matplotlib, SciPy).\n *\n * @returns An XAICodeExecutionTool 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 codeExecution = tools.xaiCodeExecution();\n * const result = await llm.invoke(\n * \"Calculate the compound interest for $10,000 at 5% annually for 10 years\",\n * { tools: [codeExecution] }\n * );\n * ```\n *\n * @example Combining with search tools\n * ```typescript\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Find the current stock price of AAPL and calculate what it would be worth with 10% annual growth over 5 years\",\n * { tools: [webSearch, codeExecution] }\n * );\n * ```\n */\nexport declare function xaiCodeExecution(): XAICodeExecutionTool;\n//# sourceMappingURL=code_execution.d.ts.map"],"mappings":";;AAIA;AAYA;AA2CA;cAvDqBA,4BAAAA;;;;;;;;;;;;UAYJC,oBAAAA;;;;eAIAD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCOE,gBAAAA,CAAAA,GAAoBD"}
1
+ {"version":3,"file":"code_execution.d.ts","names":[],"sources":["../../src/tools/code_execution.ts"],"mappings":";;AAIA;;;cAAa,4BAAA;;AAab;;;;;AA4CA;;;;;UA5CiB,oBAAA;;;;EAIf,IAAA,SAAa,4BAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwCC,gBAAA,CAAA,GAAoB,oBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"code_execution.js","names":[],"sources":["../../src/tools/code_execution.ts"],"sourcesContent":["/**\n * xAI Code Execution tool type constant.\n * Note: The Responses API uses \"code_interpreter\" as the type name.\n */\nexport const XAI_CODE_EXECUTION_TOOL_TYPE = \"code_interpreter\";\n\n/**\n * xAI's built-in code execution tool interface.\n * Enables the model to write and execute Python code in real-time.\n *\n * This tool is part of xAI's agentic tool calling API and allows for:\n * - Mathematical computations\n * - Data analysis\n * - Financial modeling\n * - Scientific computing\n * - Code generation and testing\n */\nexport interface XAICodeExecutionTool {\n /**\n * The type of the tool. Must be \"code_interpreter\".\n */\n type: typeof XAI_CODE_EXECUTION_TOOL_TYPE;\n}\n\n/**\n * Creates an xAI code execution tool.\n * Enables the model to write and execute Python code in real-time for\n * calculations, data analysis, and complex computations.\n *\n * This tool is executed server-side by the xAI API in a secure, sandboxed\n * Python environment with common libraries pre-installed (NumPy, Pandas,\n * Matplotlib, SciPy).\n *\n * @returns An XAICodeExecutionTool 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 codeExecution = tools.xaiCodeExecution();\n * const result = await llm.invoke(\n * \"Calculate the compound interest for $10,000 at 5% annually for 10 years\",\n * { tools: [codeExecution] }\n * );\n * ```\n *\n * @example Combining with search tools\n * ```typescript\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Find the current stock price of AAPL and calculate what it would be worth with 10% annual growth over 5 years\",\n * { tools: [webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCodeExecution(): XAICodeExecutionTool {\n return {\n type: XAI_CODE_EXECUTION_TOOL_TYPE,\n };\n}\n"],"mappings":";;;;;AAIA,MAAa,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyD5C,SAAgB,mBAAyC;AACvD,QAAO,EACL,MAAM,6BACP;AACF"}
1
+ {"version":3,"file":"code_execution.js","names":[],"sources":["../../src/tools/code_execution.ts"],"sourcesContent":["/**\n * xAI Code Execution tool type constant.\n * Note: The Responses API uses \"code_interpreter\" as the type name.\n */\nexport const XAI_CODE_EXECUTION_TOOL_TYPE = \"code_interpreter\";\n\n/**\n * xAI's built-in code execution tool interface.\n * Enables the model to write and execute Python code in real-time.\n *\n * This tool is part of xAI's agentic tool calling API and allows for:\n * - Mathematical computations\n * - Data analysis\n * - Financial modeling\n * - Scientific computing\n * - Code generation and testing\n */\nexport interface XAICodeExecutionTool {\n /**\n * The type of the tool. Must be \"code_interpreter\".\n */\n type: typeof XAI_CODE_EXECUTION_TOOL_TYPE;\n}\n\n/**\n * Creates an xAI code execution tool.\n * Enables the model to write and execute Python code in real-time for\n * calculations, data analysis, and complex computations.\n *\n * This tool is executed server-side by the xAI API in a secure, sandboxed\n * Python environment with common libraries pre-installed (NumPy, Pandas,\n * Matplotlib, SciPy).\n *\n * @returns An XAICodeExecutionTool 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 codeExecution = tools.xaiCodeExecution();\n * const result = await llm.invoke(\n * \"Calculate the compound interest for $10,000 at 5% annually for 10 years\",\n * { tools: [codeExecution] }\n * );\n * ```\n *\n * @example Combining with search tools\n * ```typescript\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Find the current stock price of AAPL and calculate what it would be worth with 10% annual growth over 5 years\",\n * { tools: [webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCodeExecution(): XAICodeExecutionTool {\n return {\n type: XAI_CODE_EXECUTION_TOOL_TYPE,\n };\n}\n"],"mappings":";;;;;AAIA,MAAa,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyD5C,SAAgB,mBAAyC;AACvD,QAAO,EACL,MAAM,8BACP"}
@@ -1 +1 @@
1
- {"version":3,"file":"collections_search.cjs","names":["options: XAICollectionsSearchToolOptions","tool: XAICollectionsSearchTool"],"sources":["../../src/tools/collections_search.ts"],"sourcesContent":["/**\n * xAI Collections Search tool type constant.\n * Note: The Responses API uses \"file_search\" as the type name.\n */\nexport const XAI_COLLECTIONS_SEARCH_TOOL_TYPE = \"file_search\";\n\n/**\n * xAI's built-in collections search tool interface.\n * Enables the model to search through uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\n *\n * This tool is part of xAI's agentic tool calling API and is particularly\n * powerful for:\n * - Document retrieval from uploaded files\n * - Semantic search across knowledge bases\n * - RAG (Retrieval-Augmented Generation) applications\n * - Enterprise knowledge base queries\n */\nexport interface XAICollectionsSearchTool {\n /**\n * The type of the tool. Must be \"file_search\".\n */\n type: typeof XAI_COLLECTIONS_SEARCH_TOOL_TYPE;\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n */\n vector_store_ids?: string[];\n}\n\n/**\n * Options for the xAI collections 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 XAICollectionsSearchToolOptions {\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n *\n * @example [\"collection_abc123\", \"collection_def456\"]\n */\n vectorStoreIds?: string[];\n}\n\n/**\n * Creates an xAI collections search tool.\n * Enables the model to search through your uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\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 collections search tool\n * @returns An XAICollectionsSearchTool object to pass to the model\n *\n * @example Basic usage with collection IDs\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 collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_abc123\"],\n * });\n *\n * const result = await llm.invoke(\n * \"What are the key findings in the Q3 report?\",\n * { tools: [collectionsSearch] }\n * );\n * ```\n *\n * @example Combining with other tools for hybrid analysis\n * ```typescript\n * const collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_sec_filings\"],\n * });\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Based on our internal SEC filings, what is the market sentiment on our performance?\",\n * { tools: [collectionsSearch, webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCollectionsSearch(\n options: XAICollectionsSearchToolOptions = {}\n): XAICollectionsSearchTool {\n const tool: XAICollectionsSearchTool = {\n type: XAI_COLLECTIONS_SEARCH_TOOL_TYPE,\n };\n\n if (options.vectorStoreIds !== undefined) {\n tool.vector_store_ids = options.vectorStoreIds;\n }\n\n return tool;\n}\n"],"mappings":";;;;;;AAIA,MAAa,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFhD,SAAgB,qBACdA,UAA2C,CAAE,GACnB;CAC1B,MAAMC,OAAiC,EACrC,MAAM,iCACP;AAED,KAAI,QAAQ,mBAAmB,QAC7B,KAAK,mBAAmB,QAAQ;AAGlC,QAAO;AACR"}
1
+ {"version":3,"file":"collections_search.cjs","names":[],"sources":["../../src/tools/collections_search.ts"],"sourcesContent":["/**\n * xAI Collections Search tool type constant.\n * Note: The Responses API uses \"file_search\" as the type name.\n */\nexport const XAI_COLLECTIONS_SEARCH_TOOL_TYPE = \"file_search\";\n\n/**\n * xAI's built-in collections search tool interface.\n * Enables the model to search through uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\n *\n * This tool is part of xAI's agentic tool calling API and is particularly\n * powerful for:\n * - Document retrieval from uploaded files\n * - Semantic search across knowledge bases\n * - RAG (Retrieval-Augmented Generation) applications\n * - Enterprise knowledge base queries\n */\nexport interface XAICollectionsSearchTool {\n /**\n * The type of the tool. Must be \"file_search\".\n */\n type: typeof XAI_COLLECTIONS_SEARCH_TOOL_TYPE;\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n */\n vector_store_ids?: string[];\n}\n\n/**\n * Options for the xAI collections 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 XAICollectionsSearchToolOptions {\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n *\n * @example [\"collection_abc123\", \"collection_def456\"]\n */\n vectorStoreIds?: string[];\n}\n\n/**\n * Creates an xAI collections search tool.\n * Enables the model to search through your uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\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 collections search tool\n * @returns An XAICollectionsSearchTool object to pass to the model\n *\n * @example Basic usage with collection IDs\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 collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_abc123\"],\n * });\n *\n * const result = await llm.invoke(\n * \"What are the key findings in the Q3 report?\",\n * { tools: [collectionsSearch] }\n * );\n * ```\n *\n * @example Combining with other tools for hybrid analysis\n * ```typescript\n * const collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_sec_filings\"],\n * });\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Based on our internal SEC filings, what is the market sentiment on our performance?\",\n * { tools: [collectionsSearch, webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCollectionsSearch(\n options: XAICollectionsSearchToolOptions = {}\n): XAICollectionsSearchTool {\n const tool: XAICollectionsSearchTool = {\n type: XAI_COLLECTIONS_SEARCH_TOOL_TYPE,\n };\n\n if (options.vectorStoreIds !== undefined) {\n tool.vector_store_ids = options.vectorStoreIds;\n }\n\n return tool;\n}\n"],"mappings":";;;;;;AAIA,MAAa,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFhD,SAAgB,qBACd,UAA2C,EAAE,EACnB;CAC1B,MAAM,OAAiC,EACrC,MAAM,kCACP;AAED,KAAI,QAAQ,mBAAmB,OAC7B,MAAK,mBAAmB,QAAQ;AAGlC,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"collections_search.d.cts","names":["XAI_COLLECTIONS_SEARCH_TOOL_TYPE","XAICollectionsSearchTool","XAICollectionsSearchToolOptions","xaiCollectionsSearch"],"sources":["../../src/tools/collections_search.d.ts"],"sourcesContent":["/**\n * xAI Collections Search tool type constant.\n * Note: The Responses API uses \"file_search\" as the type name.\n */\nexport declare const XAI_COLLECTIONS_SEARCH_TOOL_TYPE = \"file_search\";\n/**\n * xAI's built-in collections search tool interface.\n * Enables the model to search through uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\n *\n * This tool is part of xAI's agentic tool calling API and is particularly\n * powerful for:\n * - Document retrieval from uploaded files\n * - Semantic search across knowledge bases\n * - RAG (Retrieval-Augmented Generation) applications\n * - Enterprise knowledge base queries\n */\nexport interface XAICollectionsSearchTool {\n /**\n * The type of the tool. Must be \"file_search\".\n */\n type: typeof XAI_COLLECTIONS_SEARCH_TOOL_TYPE;\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n */\n vector_store_ids?: string[];\n}\n/**\n * Options for the xAI collections 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 XAICollectionsSearchToolOptions {\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n *\n * @example [\"collection_abc123\", \"collection_def456\"]\n */\n vectorStoreIds?: string[];\n}\n/**\n * Creates an xAI collections search tool.\n * Enables the model to search through your uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\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 collections search tool\n * @returns An XAICollectionsSearchTool object to pass to the model\n *\n * @example Basic usage with collection IDs\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 collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_abc123\"],\n * });\n *\n * const result = await llm.invoke(\n * \"What are the key findings in the Q3 report?\",\n * { tools: [collectionsSearch] }\n * );\n * ```\n *\n * @example Combining with other tools for hybrid analysis\n * ```typescript\n * const collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_sec_filings\"],\n * });\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Based on our internal SEC filings, what is the market sentiment on our performance?\",\n * { tools: [collectionsSearch, webSearch, codeExecution] }\n * );\n * ```\n */\nexport declare function xaiCollectionsSearch(options?: XAICollectionsSearchToolOptions): XAICollectionsSearchTool;\n//# sourceMappingURL=collections_search.d.ts.map"],"mappings":";;AAIA;AAaA;AAgBA;AAoDwBG,cAjFHH,gCAAAA,GAiFkCE,aAAAA;;;;;;;;;;;;;UApEtCD,wBAAAA;;;;eAIAD;;;;;;;;;;;;UAYAE,+BAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDOC,oBAAAA,WAA+BD,kCAAkCD"}
1
+ {"version":3,"file":"collections_search.d.cts","names":[],"sources":["../../src/tools/collections_search.ts"],"mappings":";;AAIA;;;cAAa,gCAAA;;AAcb;;;;;;;;;AAiBA;;UAjBiB,wBAAA;EAwBf;;AA8CF;EAlEE,IAAA,SAAa,gCAAA;;;;;EAKb,gBAAA;AAAA;;;;;;UAQe,+BAAA;;;;;;;EAOf,cAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Cc,oBAAA,CACd,OAAA,GAAS,+BAAA,GACR,wBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"collections_search.d.ts","names":["XAI_COLLECTIONS_SEARCH_TOOL_TYPE","XAICollectionsSearchTool","XAICollectionsSearchToolOptions","xaiCollectionsSearch"],"sources":["../../src/tools/collections_search.d.ts"],"sourcesContent":["/**\n * xAI Collections Search tool type constant.\n * Note: The Responses API uses \"file_search\" as the type name.\n */\nexport declare const XAI_COLLECTIONS_SEARCH_TOOL_TYPE = \"file_search\";\n/**\n * xAI's built-in collections search tool interface.\n * Enables the model to search through uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\n *\n * This tool is part of xAI's agentic tool calling API and is particularly\n * powerful for:\n * - Document retrieval from uploaded files\n * - Semantic search across knowledge bases\n * - RAG (Retrieval-Augmented Generation) applications\n * - Enterprise knowledge base queries\n */\nexport interface XAICollectionsSearchTool {\n /**\n * The type of the tool. Must be \"file_search\".\n */\n type: typeof XAI_COLLECTIONS_SEARCH_TOOL_TYPE;\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n */\n vector_store_ids?: string[];\n}\n/**\n * Options for the xAI collections 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 XAICollectionsSearchToolOptions {\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n *\n * @example [\"collection_abc123\", \"collection_def456\"]\n */\n vectorStoreIds?: string[];\n}\n/**\n * Creates an xAI collections search tool.\n * Enables the model to search through your uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\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 collections search tool\n * @returns An XAICollectionsSearchTool object to pass to the model\n *\n * @example Basic usage with collection IDs\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 collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_abc123\"],\n * });\n *\n * const result = await llm.invoke(\n * \"What are the key findings in the Q3 report?\",\n * { tools: [collectionsSearch] }\n * );\n * ```\n *\n * @example Combining with other tools for hybrid analysis\n * ```typescript\n * const collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_sec_filings\"],\n * });\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Based on our internal SEC filings, what is the market sentiment on our performance?\",\n * { tools: [collectionsSearch, webSearch, codeExecution] }\n * );\n * ```\n */\nexport declare function xaiCollectionsSearch(options?: XAICollectionsSearchToolOptions): XAICollectionsSearchTool;\n//# sourceMappingURL=collections_search.d.ts.map"],"mappings":";;AAIA;AAaA;AAgBA;AAoDwBG,cAjFHH,gCAAAA,GAiFkCE,aAAAA;;;;;;;;;;;;;UApEtCD,wBAAAA;;;;eAIAD;;;;;;;;;;;;UAYAE,+BAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoDOC,oBAAAA,WAA+BD,kCAAkCD"}
1
+ {"version":3,"file":"collections_search.d.ts","names":[],"sources":["../../src/tools/collections_search.ts"],"mappings":";;AAIA;;;cAAa,gCAAA;;AAcb;;;;;;;;;AAiBA;;UAjBiB,wBAAA;EAwBf;;AA8CF;EAlEE,IAAA,SAAa,gCAAA;;;;;EAKb,gBAAA;AAAA;;;;;;UAQe,+BAAA;;;;;;;EAOf,cAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8Cc,oBAAA,CACd,OAAA,GAAS,+BAAA,GACR,wBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"collections_search.js","names":["options: XAICollectionsSearchToolOptions","tool: XAICollectionsSearchTool"],"sources":["../../src/tools/collections_search.ts"],"sourcesContent":["/**\n * xAI Collections Search tool type constant.\n * Note: The Responses API uses \"file_search\" as the type name.\n */\nexport const XAI_COLLECTIONS_SEARCH_TOOL_TYPE = \"file_search\";\n\n/**\n * xAI's built-in collections search tool interface.\n * Enables the model to search through uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\n *\n * This tool is part of xAI's agentic tool calling API and is particularly\n * powerful for:\n * - Document retrieval from uploaded files\n * - Semantic search across knowledge bases\n * - RAG (Retrieval-Augmented Generation) applications\n * - Enterprise knowledge base queries\n */\nexport interface XAICollectionsSearchTool {\n /**\n * The type of the tool. Must be \"file_search\".\n */\n type: typeof XAI_COLLECTIONS_SEARCH_TOOL_TYPE;\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n */\n vector_store_ids?: string[];\n}\n\n/**\n * Options for the xAI collections 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 XAICollectionsSearchToolOptions {\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n *\n * @example [\"collection_abc123\", \"collection_def456\"]\n */\n vectorStoreIds?: string[];\n}\n\n/**\n * Creates an xAI collections search tool.\n * Enables the model to search through your uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\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 collections search tool\n * @returns An XAICollectionsSearchTool object to pass to the model\n *\n * @example Basic usage with collection IDs\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 collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_abc123\"],\n * });\n *\n * const result = await llm.invoke(\n * \"What are the key findings in the Q3 report?\",\n * { tools: [collectionsSearch] }\n * );\n * ```\n *\n * @example Combining with other tools for hybrid analysis\n * ```typescript\n * const collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_sec_filings\"],\n * });\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Based on our internal SEC filings, what is the market sentiment on our performance?\",\n * { tools: [collectionsSearch, webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCollectionsSearch(\n options: XAICollectionsSearchToolOptions = {}\n): XAICollectionsSearchTool {\n const tool: XAICollectionsSearchTool = {\n type: XAI_COLLECTIONS_SEARCH_TOOL_TYPE,\n };\n\n if (options.vectorStoreIds !== undefined) {\n tool.vector_store_ids = options.vectorStoreIds;\n }\n\n return tool;\n}\n"],"mappings":";;;;;AAIA,MAAa,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFhD,SAAgB,qBACdA,UAA2C,CAAE,GACnB;CAC1B,MAAMC,OAAiC,EACrC,MAAM,iCACP;AAED,KAAI,QAAQ,mBAAmB,QAC7B,KAAK,mBAAmB,QAAQ;AAGlC,QAAO;AACR"}
1
+ {"version":3,"file":"collections_search.js","names":[],"sources":["../../src/tools/collections_search.ts"],"sourcesContent":["/**\n * xAI Collections Search tool type constant.\n * Note: The Responses API uses \"file_search\" as the type name.\n */\nexport const XAI_COLLECTIONS_SEARCH_TOOL_TYPE = \"file_search\";\n\n/**\n * xAI's built-in collections search tool interface.\n * Enables the model to search through uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\n *\n * This tool is part of xAI's agentic tool calling API and is particularly\n * powerful for:\n * - Document retrieval from uploaded files\n * - Semantic search across knowledge bases\n * - RAG (Retrieval-Augmented Generation) applications\n * - Enterprise knowledge base queries\n */\nexport interface XAICollectionsSearchTool {\n /**\n * The type of the tool. Must be \"file_search\".\n */\n type: typeof XAI_COLLECTIONS_SEARCH_TOOL_TYPE;\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n */\n vector_store_ids?: string[];\n}\n\n/**\n * Options for the xAI collections 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 XAICollectionsSearchToolOptions {\n /**\n * List of vector store (collection) IDs to search.\n * These are the IDs of collections created via the xAI Collections API.\n *\n * @example [\"collection_abc123\", \"collection_def456\"]\n */\n vectorStoreIds?: string[];\n}\n\n/**\n * Creates an xAI collections search tool.\n * Enables the model to search through your uploaded knowledge bases (collections)\n * to retrieve relevant information from your documents.\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 collections search tool\n * @returns An XAICollectionsSearchTool object to pass to the model\n *\n * @example Basic usage with collection IDs\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 collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_abc123\"],\n * });\n *\n * const result = await llm.invoke(\n * \"What are the key findings in the Q3 report?\",\n * { tools: [collectionsSearch] }\n * );\n * ```\n *\n * @example Combining with other tools for hybrid analysis\n * ```typescript\n * const collectionsSearch = tools.xaiCollectionsSearch({\n * vectorStoreIds: [\"collection_sec_filings\"],\n * });\n * const webSearch = tools.xaiWebSearch();\n * const codeExecution = tools.xaiCodeExecution();\n *\n * const result = await llm.invoke(\n * \"Based on our internal SEC filings, what is the market sentiment on our performance?\",\n * { tools: [collectionsSearch, webSearch, codeExecution] }\n * );\n * ```\n */\nexport function xaiCollectionsSearch(\n options: XAICollectionsSearchToolOptions = {}\n): XAICollectionsSearchTool {\n const tool: XAICollectionsSearchTool = {\n type: XAI_COLLECTIONS_SEARCH_TOOL_TYPE,\n };\n\n if (options.vectorStoreIds !== undefined) {\n tool.vector_store_ids = options.vectorStoreIds;\n }\n\n return tool;\n}\n"],"mappings":";;;;;AAIA,MAAa,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFhD,SAAgB,qBACd,UAA2C,EAAE,EACnB;CAC1B,MAAM,OAAiC,EACrC,MAAM,kCACP;AAED,KAAI,QAAQ,mBAAmB,OAC7B,MAAK,mBAAmB,QAAQ;AAGlC,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nimport { xaiWebSearch } from \"./web_search.js\";\nimport { xaiXSearch } from \"./x_search.js\";\nimport { xaiCodeExecution } from \"./code_execution.js\";\nimport { xaiCollectionsSearch } from \"./collections_search.js\";\n\nexport const tools = {\n /** @deprecated Use xaiWebSearch and xaiXSearch instead */\n xaiLiveSearch,\n xaiWebSearch,\n xaiXSearch,\n xaiCodeExecution,\n xaiCollectionsSearch,\n};\n\n// Re-export types for convenience\nexport type {\n XAILiveSearchTool,\n XAILiveSearchToolOptions,\n} from \"./live_search.js\";\nexport type {\n XAIWebSearchTool,\n XAIWebSearchToolOptions,\n} from \"./web_search.js\";\nexport type { XAIXSearchTool, XAIXSearchToolOptions } from \"./x_search.js\";\nexport type { XAICodeExecutionTool } from \"./code_execution.js\";\nexport type {\n XAICollectionsSearchTool,\n XAICollectionsSearchToolOptions,\n} from \"./collections_search.js\";\n\n// Re-export tool type constants\nexport {\n XAI_LIVE_SEARCH_TOOL_TYPE,\n XAI_LIVE_SEARCH_TOOL_NAME,\n} from \"./live_search.js\";\nexport { XAI_WEB_SEARCH_TOOL_TYPE } from \"./web_search.js\";\nexport { XAI_X_SEARCH_TOOL_TYPE } from \"./x_search.js\";\nexport { XAI_CODE_EXECUTION_TOOL_TYPE } from \"./code_execution.js\";\nexport { XAI_COLLECTIONS_SEARCH_TOOL_TYPE } from \"./collections_search.js\";\n"],"mappings":";;;;;;;AAMA,MAAa,QAAQ;CAEnB;CACA;CACA;CACA;CACA;AACD"}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nimport { xaiWebSearch } from \"./web_search.js\";\nimport { xaiXSearch } from \"./x_search.js\";\nimport { xaiCodeExecution } from \"./code_execution.js\";\nimport { xaiCollectionsSearch } from \"./collections_search.js\";\n\nexport const tools = {\n /** @deprecated Use xaiWebSearch and xaiXSearch instead */\n xaiLiveSearch,\n xaiWebSearch,\n xaiXSearch,\n xaiCodeExecution,\n xaiCollectionsSearch,\n};\n\n// Re-export types for convenience\nexport type {\n XAILiveSearchTool,\n XAILiveSearchToolOptions,\n} from \"./live_search.js\";\nexport type {\n XAIWebSearchTool,\n XAIWebSearchToolOptions,\n} from \"./web_search.js\";\nexport type { XAIXSearchTool, XAIXSearchToolOptions } from \"./x_search.js\";\nexport type { XAICodeExecutionTool } from \"./code_execution.js\";\nexport type {\n XAICollectionsSearchTool,\n XAICollectionsSearchToolOptions,\n} from \"./collections_search.js\";\n\n// Re-export tool type constants\nexport {\n XAI_LIVE_SEARCH_TOOL_TYPE,\n XAI_LIVE_SEARCH_TOOL_NAME,\n} from \"./live_search.js\";\nexport { XAI_WEB_SEARCH_TOOL_TYPE } from \"./web_search.js\";\nexport { XAI_X_SEARCH_TOOL_TYPE } from \"./x_search.js\";\nexport { XAI_CODE_EXECUTION_TOOL_TYPE } from \"./code_execution.js\";\nexport { XAI_COLLECTIONS_SEARCH_TOOL_TYPE } from \"./collections_search.js\";\n"],"mappings":";;;;;;;AAMA,MAAa,QAAQ;CAEnB;CACA;CACA;CACA;CACA;CACD"}
@@ -6,8 +6,7 @@ import { XAICollectionsSearchTool, XAICollectionsSearchToolOptions, XAI_COLLECTI
6
6
 
7
7
  //#region src/tools/index.d.ts
8
8
  declare const tools: {
9
- /** @deprecated Use xaiWebSearch and xaiXSearch instead */
10
- xaiLiveSearch: typeof xaiLiveSearch;
9
+ /** @deprecated Use xaiWebSearch and xaiXSearch instead */xaiLiveSearch: typeof xaiLiveSearch;
11
10
  xaiWebSearch: typeof xaiWebSearch;
12
11
  xaiXSearch: typeof xaiXSearch;
13
12
  xaiCodeExecution: typeof xaiCodeExecution;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":["xaiLiveSearch","xaiWebSearch","xaiXSearch","xaiCodeExecution","xaiCollectionsSearch","tools","XAILiveSearchTool","XAILiveSearchToolOptions","XAIWebSearchTool","XAIWebSearchToolOptions","XAIXSearchTool","XAIXSearchToolOptions","XAICodeExecutionTool","XAICollectionsSearchTool","XAICollectionsSearchToolOptions","XAI_LIVE_SEARCH_TOOL_TYPE","XAI_LIVE_SEARCH_TOOL_NAME","XAI_WEB_SEARCH_TOOL_TYPE","XAI_X_SEARCH_TOOL_TYPE","XAI_CODE_EXECUTION_TOOL_TYPE","XAI_COLLECTIONS_SEARCH_TOOL_TYPE"],"sources":["../../src/tools/index.d.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nimport { xaiWebSearch } from \"./web_search.js\";\nimport { xaiXSearch } from \"./x_search.js\";\nimport { xaiCodeExecution } from \"./code_execution.js\";\nimport { xaiCollectionsSearch } from \"./collections_search.js\";\nexport declare const tools: {\n /** @deprecated Use xaiWebSearch and xaiXSearch instead */\n xaiLiveSearch: typeof xaiLiveSearch;\n xaiWebSearch: typeof xaiWebSearch;\n xaiXSearch: typeof xaiXSearch;\n xaiCodeExecution: typeof xaiCodeExecution;\n xaiCollectionsSearch: typeof xaiCollectionsSearch;\n};\nexport type { XAILiveSearchTool, XAILiveSearchToolOptions, } from \"./live_search.js\";\nexport type { XAIWebSearchTool, XAIWebSearchToolOptions, } from \"./web_search.js\";\nexport type { XAIXSearchTool, XAIXSearchToolOptions } from \"./x_search.js\";\nexport type { XAICodeExecutionTool } from \"./code_execution.js\";\nexport type { XAICollectionsSearchTool, XAICollectionsSearchToolOptions, } from \"./collections_search.js\";\nexport { XAI_LIVE_SEARCH_TOOL_TYPE, XAI_LIVE_SEARCH_TOOL_NAME, } from \"./live_search.js\";\nexport { XAI_WEB_SEARCH_TOOL_TYPE } from \"./web_search.js\";\nexport { XAI_X_SEARCH_TOOL_TYPE } from \"./x_search.js\";\nexport { XAI_CODE_EXECUTION_TOOL_TYPE } from \"./code_execution.js\";\nexport { XAI_COLLECTIONS_SEARCH_TOOL_TYPE } from \"./collections_search.js\";\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;cAKqBK;;EAAAA,aAOpB,EAAA,OALyBL,aAKzB;EALyBA,YAAAA,EAAAA,OACDC,YADCD;EACDC,UAAAA,EAAAA,OACFC,UADED;EACFC,gBAAAA,EAAAA,OACMC,gBADND;EACMC,oBAAAA,EAAAA,OACIC,oBADJD;CACIC"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;cAMa,KAAA"}
@@ -6,8 +6,7 @@ import { XAICollectionsSearchTool, XAICollectionsSearchToolOptions, XAI_COLLECTI
6
6
 
7
7
  //#region src/tools/index.d.ts
8
8
  declare const tools: {
9
- /** @deprecated Use xaiWebSearch and xaiXSearch instead */
10
- xaiLiveSearch: typeof xaiLiveSearch;
9
+ /** @deprecated Use xaiWebSearch and xaiXSearch instead */xaiLiveSearch: typeof xaiLiveSearch;
11
10
  xaiWebSearch: typeof xaiWebSearch;
12
11
  xaiXSearch: typeof xaiXSearch;
13
12
  xaiCodeExecution: typeof xaiCodeExecution;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["xaiLiveSearch","xaiWebSearch","xaiXSearch","xaiCodeExecution","xaiCollectionsSearch","tools","XAILiveSearchTool","XAILiveSearchToolOptions","XAIWebSearchTool","XAIWebSearchToolOptions","XAIXSearchTool","XAIXSearchToolOptions","XAICodeExecutionTool","XAICollectionsSearchTool","XAICollectionsSearchToolOptions","XAI_LIVE_SEARCH_TOOL_TYPE","XAI_LIVE_SEARCH_TOOL_NAME","XAI_WEB_SEARCH_TOOL_TYPE","XAI_X_SEARCH_TOOL_TYPE","XAI_CODE_EXECUTION_TOOL_TYPE","XAI_COLLECTIONS_SEARCH_TOOL_TYPE"],"sources":["../../src/tools/index.d.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nimport { xaiWebSearch } from \"./web_search.js\";\nimport { xaiXSearch } from \"./x_search.js\";\nimport { xaiCodeExecution } from \"./code_execution.js\";\nimport { xaiCollectionsSearch } from \"./collections_search.js\";\nexport declare const tools: {\n /** @deprecated Use xaiWebSearch and xaiXSearch instead */\n xaiLiveSearch: typeof xaiLiveSearch;\n xaiWebSearch: typeof xaiWebSearch;\n xaiXSearch: typeof xaiXSearch;\n xaiCodeExecution: typeof xaiCodeExecution;\n xaiCollectionsSearch: typeof xaiCollectionsSearch;\n};\nexport type { XAILiveSearchTool, XAILiveSearchToolOptions, } from \"./live_search.js\";\nexport type { XAIWebSearchTool, XAIWebSearchToolOptions, } from \"./web_search.js\";\nexport type { XAIXSearchTool, XAIXSearchToolOptions } from \"./x_search.js\";\nexport type { XAICodeExecutionTool } from \"./code_execution.js\";\nexport type { XAICollectionsSearchTool, XAICollectionsSearchToolOptions, } from \"./collections_search.js\";\nexport { XAI_LIVE_SEARCH_TOOL_TYPE, XAI_LIVE_SEARCH_TOOL_NAME, } from \"./live_search.js\";\nexport { XAI_WEB_SEARCH_TOOL_TYPE } from \"./web_search.js\";\nexport { XAI_X_SEARCH_TOOL_TYPE } from \"./x_search.js\";\nexport { XAI_CODE_EXECUTION_TOOL_TYPE } from \"./code_execution.js\";\nexport { XAI_COLLECTIONS_SEARCH_TOOL_TYPE } from \"./collections_search.js\";\n//# sourceMappingURL=index.d.ts.map"],"mappings":";;;;;;;cAKqBK;;EAAAA,aAOpB,EAAA,OALyBL,aAKzB;EALyBA,YAAAA,EAAAA,OACDC,YADCD;EACDC,UAAAA,EAAAA,OACFC,UADED;EACFC,gBAAAA,EAAAA,OACMC,gBADND;EACMC,oBAAAA,EAAAA,OACIC,oBADJD;CACIC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/tools/index.ts"],"mappings":";;;;;;;cAMa,KAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nimport { xaiWebSearch } from \"./web_search.js\";\nimport { xaiXSearch } from \"./x_search.js\";\nimport { xaiCodeExecution } from \"./code_execution.js\";\nimport { xaiCollectionsSearch } from \"./collections_search.js\";\n\nexport const tools = {\n /** @deprecated Use xaiWebSearch and xaiXSearch instead */\n xaiLiveSearch,\n xaiWebSearch,\n xaiXSearch,\n xaiCodeExecution,\n xaiCollectionsSearch,\n};\n\n// Re-export types for convenience\nexport type {\n XAILiveSearchTool,\n XAILiveSearchToolOptions,\n} from \"./live_search.js\";\nexport type {\n XAIWebSearchTool,\n XAIWebSearchToolOptions,\n} from \"./web_search.js\";\nexport type { XAIXSearchTool, XAIXSearchToolOptions } from \"./x_search.js\";\nexport type { XAICodeExecutionTool } from \"./code_execution.js\";\nexport type {\n XAICollectionsSearchTool,\n XAICollectionsSearchToolOptions,\n} from \"./collections_search.js\";\n\n// Re-export tool type constants\nexport {\n XAI_LIVE_SEARCH_TOOL_TYPE,\n XAI_LIVE_SEARCH_TOOL_NAME,\n} from \"./live_search.js\";\nexport { XAI_WEB_SEARCH_TOOL_TYPE } from \"./web_search.js\";\nexport { XAI_X_SEARCH_TOOL_TYPE } from \"./x_search.js\";\nexport { XAI_CODE_EXECUTION_TOOL_TYPE } from \"./code_execution.js\";\nexport { XAI_COLLECTIONS_SEARCH_TOOL_TYPE } from \"./collections_search.js\";\n"],"mappings":";;;;;;;AAMA,MAAa,QAAQ;CAEnB;CACA;CACA;CACA;CACA;AACD"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/tools/index.ts"],"sourcesContent":["import { xaiLiveSearch } from \"./live_search.js\";\nimport { xaiWebSearch } from \"./web_search.js\";\nimport { xaiXSearch } from \"./x_search.js\";\nimport { xaiCodeExecution } from \"./code_execution.js\";\nimport { xaiCollectionsSearch } from \"./collections_search.js\";\n\nexport const tools = {\n /** @deprecated Use xaiWebSearch and xaiXSearch instead */\n xaiLiveSearch,\n xaiWebSearch,\n xaiXSearch,\n xaiCodeExecution,\n xaiCollectionsSearch,\n};\n\n// Re-export types for convenience\nexport type {\n XAILiveSearchTool,\n XAILiveSearchToolOptions,\n} from \"./live_search.js\";\nexport type {\n XAIWebSearchTool,\n XAIWebSearchToolOptions,\n} from \"./web_search.js\";\nexport type { XAIXSearchTool, XAIXSearchToolOptions } from \"./x_search.js\";\nexport type { XAICodeExecutionTool } from \"./code_execution.js\";\nexport type {\n XAICollectionsSearchTool,\n XAICollectionsSearchToolOptions,\n} from \"./collections_search.js\";\n\n// Re-export tool type constants\nexport {\n XAI_LIVE_SEARCH_TOOL_TYPE,\n XAI_LIVE_SEARCH_TOOL_NAME,\n} from \"./live_search.js\";\nexport { XAI_WEB_SEARCH_TOOL_TYPE } from \"./web_search.js\";\nexport { XAI_X_SEARCH_TOOL_TYPE } from \"./x_search.js\";\nexport { XAI_CODE_EXECUTION_TOOL_TYPE } from \"./code_execution.js\";\nexport { XAI_COLLECTIONS_SEARCH_TOOL_TYPE } from \"./collections_search.js\";\n"],"mappings":";;;;;;;AAMA,MAAa,QAAQ;CAEnB;CACA;CACA;CACA;CACA;CACD"}
@@ -31,10 +31,7 @@ function mapToolSourceToSearchSource(source) {
31
31
  type: "rss",
32
32
  links: source.links
33
33
  };
34
- default: {
35
- const _exhaustive = source;
36
- return _exhaustive;
37
- }
34
+ default: return source;
38
35
  }
39
36
  }
40
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"live_search.cjs","names":["source: XAISearchToolSource","_exhaustive: never","options: XAILiveSearchToolOptions"],"sources":["../../src/tools/live_search.ts"],"sourcesContent":["import type { XAISearchParameters, XAISearchSource } from \"../live_search.js\";\n\n/**\n * xAI's deprecated live_search tool type.\n */\nexport const XAI_LIVE_SEARCH_TOOL_TYPE = \"live_search_deprecated_20251215\";\nexport const XAI_LIVE_SEARCH_TOOL_NAME = \"live_search\";\n\n/**\n * xAI's built-in live_search tool type.\n * Enables the model to search the web for real-time information.\n */\nexport interface XAILiveSearchTool extends XAISearchParameters {\n /**\n * The name of the tool. Must be \"live_search\" for xAI's built-in search.\n */\n name: typeof XAI_LIVE_SEARCH_TOOL_NAME;\n /**\n * The type of the tool. This uses a deprecated Live Search API shape:\n * the advanced agentic search capabilities powering grok.com are generally\n * available in the new agentic tool calling API, and the Live Search API\n * will be deprecated by December 15, 2025.\n */\n type: typeof XAI_LIVE_SEARCH_TOOL_TYPE;\n}\n\n/**\n * Web search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIWebSource` internally.\n */\nexport interface XAIWebSearchToolSource {\n type: \"web\";\n country?: string;\n excludedWebsites?: string[];\n allowedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * News search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAINewsSource` internally.\n */\nexport interface XAINewsSearchToolSource {\n type: \"news\";\n country?: string;\n excludedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * X (formerly Twitter) search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIXSource` internally.\n */\nexport interface XAIXSearchToolSource {\n type: \"x\";\n includedXHandles?: string[];\n excludedXHandles?: string[];\n postFavoriteCount?: number;\n postViewCount?: number;\n}\n\n/**\n * RSS feed search source configuration for the xAI live search tool.\n * The structure matches `XAIRssSource` (only `links`).\n */\nexport interface XAIRssSearchToolSource {\n type: \"rss\";\n links: string[];\n}\n\nexport type XAISearchToolSource =\n | XAIWebSearchToolSource\n | XAINewsSearchToolSource\n | XAIXSearchToolSource\n | XAIRssSearchToolSource;\n\n/**\n * Options for the xAI live 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 underlying `XAISearchParameters`\n * object that is sent to xAI's deprecated Live Search API.\n */\nexport interface XAILiveSearchToolOptions {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n maxSearchResults?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n fromDate?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n toDate?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n returnCitations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * These are converted to the snake_case `XAISearchSource` structures\n * used by the underlying xAI Live Search API.\n */\n sources?: XAISearchToolSource[];\n}\n\nfunction mapToolSourceToSearchSource(\n source: XAISearchToolSource\n): XAISearchSource {\n switch (source.type) {\n case \"web\":\n return {\n type: \"web\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.allowedWebsites !== undefined && {\n allowed_websites: source.allowedWebsites,\n }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"news\":\n return {\n type: \"news\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"x\":\n return {\n type: \"x\",\n ...(source.includedXHandles !== undefined && {\n included_x_handles: source.includedXHandles,\n }),\n ...(source.excludedXHandles !== undefined && {\n excluded_x_handles: source.excludedXHandles,\n }),\n ...(source.postFavoriteCount !== undefined && {\n post_favorite_count: source.postFavoriteCount,\n }),\n ...(source.postViewCount !== undefined && {\n post_view_count: source.postViewCount,\n }),\n };\n case \"rss\":\n return {\n type: \"rss\",\n links: source.links,\n };\n default: {\n const _exhaustive: never = source;\n return _exhaustive;\n }\n }\n}\n\n/**\n * Creates an xAI built-in live search tool.\n * Enables the model to search the web for real-time information.\n *\n * This tool is executed server-side by the xAI API.\n *\n * @deprecated The Live Search API was deprecated by xAI on December 15, 2025.\n * Use the new agentic tool calling API instead with `xaiWebSearch()` and `xaiXSearch()`.\n *\n * @example Migration to new tools:\n * ```typescript\n * // Old (deprecated):\n * const searchTool = tools.xaiLiveSearch({ maxSearchResults: 5 });\n *\n * // New (recommended):\n * const webSearch = tools.xaiWebSearch({ allowedDomains: [\"example.com\"] });\n * const xSearch = tools.xaiXSearch({ allowedXHandles: [\"elonmusk\"] });\n * ```\n *\n * @example\n * ```typescript\n * import { ChatXAI, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * });\n *\n * const searchTool = tools.xaiLiveSearch({\n * maxSearchResults: 5,\n * fromDate: \"2024-01-01\",\n * returnCitations: true\n * });\n *\n * const llmWithSearch = llm.bindTools([searchTool]);\n * const result = await llmWithSearch.invoke(\"What happened in tech today?\");\n * ```\n */\nexport function xaiLiveSearch(\n options: XAILiveSearchToolOptions = {}\n): XAILiveSearchTool {\n return {\n type: XAI_LIVE_SEARCH_TOOL_TYPE,\n name: XAI_LIVE_SEARCH_TOOL_NAME,\n mode: options?.mode,\n max_search_results: options?.maxSearchResults,\n from_date: options?.fromDate,\n to_date: options?.toDate,\n return_citations: options?.returnCitations,\n sources: options?.sources?.map(mapToolSourceToSearchSource),\n } satisfies XAILiveSearchTool;\n}\n"],"mappings":";;;;;AAKA,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AAgHzC,SAAS,4BACPA,QACiB;AACjB,SAAQ,OAAO,MAAf;EACE,KAAK,MACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,QAAS;GAC/D,GAAI,OAAO,oBAAoB,UAAa,EAC1C,kBAAkB,OAAO,gBAC1B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,iBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,WACrB;EACF;EACH,KAAK,OACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,QAAS;GAC/D,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,iBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,WACrB;EACF;EACH,KAAK,IACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,iBAC5B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,iBAC5B;GACD,GAAI,OAAO,sBAAsB,UAAa,EAC5C,qBAAqB,OAAO,kBAC7B;GACD,GAAI,OAAO,kBAAkB,UAAa,EACxC,iBAAiB,OAAO,cACzB;EACF;EACH,KAAK,MACH,QAAO;GACL,MAAM;GACN,OAAO,OAAO;EACf;EACH,SAAS;GACP,MAAMC,cAAqB;AAC3B,UAAO;EACR;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCD,SAAgB,cACdC,UAAoC,CAAE,GACnB;AACnB,QAAO;EACL,MAAM;EACN,MAAM;EACN,MAAM,SAAS;EACf,oBAAoB,SAAS;EAC7B,WAAW,SAAS;EACpB,SAAS,SAAS;EAClB,kBAAkB,SAAS;EAC3B,SAAS,SAAS,SAAS,IAAI,4BAA4B;CAC5D;AACF"}
1
+ {"version":3,"file":"live_search.cjs","names":[],"sources":["../../src/tools/live_search.ts"],"sourcesContent":["import type { XAISearchParameters, XAISearchSource } from \"../live_search.js\";\n\n/**\n * xAI's deprecated live_search tool type.\n */\nexport const XAI_LIVE_SEARCH_TOOL_TYPE = \"live_search_deprecated_20251215\";\nexport const XAI_LIVE_SEARCH_TOOL_NAME = \"live_search\";\n\n/**\n * xAI's built-in live_search tool type.\n * Enables the model to search the web for real-time information.\n */\nexport interface XAILiveSearchTool extends XAISearchParameters {\n /**\n * The name of the tool. Must be \"live_search\" for xAI's built-in search.\n */\n name: typeof XAI_LIVE_SEARCH_TOOL_NAME;\n /**\n * The type of the tool. This uses a deprecated Live Search API shape:\n * the advanced agentic search capabilities powering grok.com are generally\n * available in the new agentic tool calling API, and the Live Search API\n * will be deprecated by December 15, 2025.\n */\n type: typeof XAI_LIVE_SEARCH_TOOL_TYPE;\n}\n\n/**\n * Web search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIWebSource` internally.\n */\nexport interface XAIWebSearchToolSource {\n type: \"web\";\n country?: string;\n excludedWebsites?: string[];\n allowedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * News search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAINewsSource` internally.\n */\nexport interface XAINewsSearchToolSource {\n type: \"news\";\n country?: string;\n excludedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * X (formerly Twitter) search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIXSource` internally.\n */\nexport interface XAIXSearchToolSource {\n type: \"x\";\n includedXHandles?: string[];\n excludedXHandles?: string[];\n postFavoriteCount?: number;\n postViewCount?: number;\n}\n\n/**\n * RSS feed search source configuration for the xAI live search tool.\n * The structure matches `XAIRssSource` (only `links`).\n */\nexport interface XAIRssSearchToolSource {\n type: \"rss\";\n links: string[];\n}\n\nexport type XAISearchToolSource =\n | XAIWebSearchToolSource\n | XAINewsSearchToolSource\n | XAIXSearchToolSource\n | XAIRssSearchToolSource;\n\n/**\n * Options for the xAI live 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 underlying `XAISearchParameters`\n * object that is sent to xAI's deprecated Live Search API.\n */\nexport interface XAILiveSearchToolOptions {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n maxSearchResults?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n fromDate?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n toDate?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n returnCitations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * These are converted to the snake_case `XAISearchSource` structures\n * used by the underlying xAI Live Search API.\n */\n sources?: XAISearchToolSource[];\n}\n\nfunction mapToolSourceToSearchSource(\n source: XAISearchToolSource\n): XAISearchSource {\n switch (source.type) {\n case \"web\":\n return {\n type: \"web\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.allowedWebsites !== undefined && {\n allowed_websites: source.allowedWebsites,\n }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"news\":\n return {\n type: \"news\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"x\":\n return {\n type: \"x\",\n ...(source.includedXHandles !== undefined && {\n included_x_handles: source.includedXHandles,\n }),\n ...(source.excludedXHandles !== undefined && {\n excluded_x_handles: source.excludedXHandles,\n }),\n ...(source.postFavoriteCount !== undefined && {\n post_favorite_count: source.postFavoriteCount,\n }),\n ...(source.postViewCount !== undefined && {\n post_view_count: source.postViewCount,\n }),\n };\n case \"rss\":\n return {\n type: \"rss\",\n links: source.links,\n };\n default: {\n const _exhaustive: never = source;\n return _exhaustive;\n }\n }\n}\n\n/**\n * Creates an xAI built-in live search tool.\n * Enables the model to search the web for real-time information.\n *\n * This tool is executed server-side by the xAI API.\n *\n * @deprecated The Live Search API was deprecated by xAI on December 15, 2025.\n * Use the new agentic tool calling API instead with `xaiWebSearch()` and `xaiXSearch()`.\n *\n * @example Migration to new tools:\n * ```typescript\n * // Old (deprecated):\n * const searchTool = tools.xaiLiveSearch({ maxSearchResults: 5 });\n *\n * // New (recommended):\n * const webSearch = tools.xaiWebSearch({ allowedDomains: [\"example.com\"] });\n * const xSearch = tools.xaiXSearch({ allowedXHandles: [\"elonmusk\"] });\n * ```\n *\n * @example\n * ```typescript\n * import { ChatXAI, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * });\n *\n * const searchTool = tools.xaiLiveSearch({\n * maxSearchResults: 5,\n * fromDate: \"2024-01-01\",\n * returnCitations: true\n * });\n *\n * const llmWithSearch = llm.bindTools([searchTool]);\n * const result = await llmWithSearch.invoke(\"What happened in tech today?\");\n * ```\n */\nexport function xaiLiveSearch(\n options: XAILiveSearchToolOptions = {}\n): XAILiveSearchTool {\n return {\n type: XAI_LIVE_SEARCH_TOOL_TYPE,\n name: XAI_LIVE_SEARCH_TOOL_NAME,\n mode: options?.mode,\n max_search_results: options?.maxSearchResults,\n from_date: options?.fromDate,\n to_date: options?.toDate,\n return_citations: options?.returnCitations,\n sources: options?.sources?.map(mapToolSourceToSearchSource),\n } satisfies XAILiveSearchTool;\n}\n"],"mappings":";;;;;AAKA,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AAgHzC,SAAS,4BACP,QACiB;AACjB,SAAQ,OAAO,MAAf;EACE,KAAK,MACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,SAAS;GAC/D,GAAI,OAAO,oBAAoB,UAAa,EAC1C,kBAAkB,OAAO,iBAC1B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,kBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,YACrB;GACF;EACH,KAAK,OACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,SAAS;GAC/D,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,kBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,YACrB;GACF;EACH,KAAK,IACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,kBAC5B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,kBAC5B;GACD,GAAI,OAAO,sBAAsB,UAAa,EAC5C,qBAAqB,OAAO,mBAC7B;GACD,GAAI,OAAO,kBAAkB,UAAa,EACxC,iBAAiB,OAAO,eACzB;GACF;EACH,KAAK,MACH,QAAO;GACL,MAAM;GACN,OAAO,OAAO;GACf;EACH,QAEE,QAD2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CjC,SAAgB,cACd,UAAoC,EAAE,EACnB;AACnB,QAAO;EACL,MAAM;EACN,MAAM;EACN,MAAM,SAAS;EACf,oBAAoB,SAAS;EAC7B,WAAW,SAAS;EACpB,SAAS,SAAS;EAClB,kBAAkB,SAAS;EAC3B,SAAS,SAAS,SAAS,IAAI,4BAA4B;EAC5D"}
@@ -1,7 +1,6 @@
1
1
  import { XAISearchParameters } from "../live_search.cjs";
2
2
 
3
3
  //#region src/tools/live_search.d.ts
4
-
5
4
  /**
6
5
  * xAI's deprecated live_search tool type.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"live_search.d.cts","names":["XAISearchParameters","XAI_LIVE_SEARCH_TOOL_TYPE","XAI_LIVE_SEARCH_TOOL_NAME","XAILiveSearchTool","XAIWebSearchToolSource","XAINewsSearchToolSource","XAIXSearchToolSource","XAIRssSearchToolSource","XAISearchToolSource","XAILiveSearchToolOptions","xaiLiveSearch"],"sources":["../../src/tools/live_search.d.ts"],"sourcesContent":["import type { XAISearchParameters } from \"../live_search.js\";\n/**\n * xAI's deprecated live_search tool type.\n */\nexport declare const XAI_LIVE_SEARCH_TOOL_TYPE = \"live_search_deprecated_20251215\";\nexport declare const XAI_LIVE_SEARCH_TOOL_NAME = \"live_search\";\n/**\n * xAI's built-in live_search tool type.\n * Enables the model to search the web for real-time information.\n */\nexport interface XAILiveSearchTool extends XAISearchParameters {\n /**\n * The name of the tool. Must be \"live_search\" for xAI's built-in search.\n */\n name: typeof XAI_LIVE_SEARCH_TOOL_NAME;\n /**\n * The type of the tool. This uses a deprecated Live Search API shape:\n * the advanced agentic search capabilities powering grok.com are generally\n * available in the new agentic tool calling API, and the Live Search API\n * will be deprecated by December 15, 2025.\n */\n type: typeof XAI_LIVE_SEARCH_TOOL_TYPE;\n}\n/**\n * Web search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIWebSource` internally.\n */\nexport interface XAIWebSearchToolSource {\n type: \"web\";\n country?: string;\n excludedWebsites?: string[];\n allowedWebsites?: string[];\n safeSearch?: boolean;\n}\n/**\n * News search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAINewsSource` internally.\n */\nexport interface XAINewsSearchToolSource {\n type: \"news\";\n country?: string;\n excludedWebsites?: string[];\n safeSearch?: boolean;\n}\n/**\n * X (formerly Twitter) search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIXSource` internally.\n */\nexport interface XAIXSearchToolSource {\n type: \"x\";\n includedXHandles?: string[];\n excludedXHandles?: string[];\n postFavoriteCount?: number;\n postViewCount?: number;\n}\n/**\n * RSS feed search source configuration for the xAI live search tool.\n * The structure matches `XAIRssSource` (only `links`).\n */\nexport interface XAIRssSearchToolSource {\n type: \"rss\";\n links: string[];\n}\nexport type XAISearchToolSource = XAIWebSearchToolSource | XAINewsSearchToolSource | XAIXSearchToolSource | XAIRssSearchToolSource;\n/**\n * Options for the xAI live 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 underlying `XAISearchParameters`\n * object that is sent to xAI's deprecated Live Search API.\n */\nexport interface XAILiveSearchToolOptions {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n maxSearchResults?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n fromDate?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n toDate?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n returnCitations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * These are converted to the snake_case `XAISearchSource` structures\n * used by the underlying xAI Live Search API.\n */\n sources?: XAISearchToolSource[];\n}\n/**\n * Creates an xAI built-in live search tool.\n * Enables the model to search the web for real-time information.\n *\n * This tool is executed server-side by the xAI API.\n *\n * @deprecated The Live Search API was deprecated by xAI on December 15, 2025.\n * Use the new agentic tool calling API instead with `xaiWebSearch()` and `xaiXSearch()`.\n *\n * @example Migration to new tools:\n * ```typescript\n * // Old (deprecated):\n * const searchTool = tools.xaiLiveSearch({ maxSearchResults: 5 });\n *\n * // New (recommended):\n * const webSearch = tools.xaiWebSearch({ allowedDomains: [\"example.com\"] });\n * const xSearch = tools.xaiXSearch({ allowedXHandles: [\"elonmusk\"] });\n * ```\n *\n * @example\n * ```typescript\n * import { ChatXAI, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * });\n *\n * const searchTool = tools.xaiLiveSearch({\n * maxSearchResults: 5,\n * fromDate: \"2024-01-01\",\n * returnCitations: true\n * });\n *\n * const llmWithSearch = llm.bindTools([searchTool]);\n * const result = await llmWithSearch.invoke(\"What happened in tech today?\");\n * ```\n */\nexport declare function xaiLiveSearch(options?: XAILiveSearchToolOptions): XAILiveSearchTool;\n//# sourceMappingURL=live_search.d.ts.map"],"mappings":";;;;;;AAIA;AACqBE,cADAD,yBAAAA,GACyB,iCAAA;AAK7BE,cALID,yBAAAA,GAKa,aAAA;;;;AAA4B;AAiB7CE,UAjBAD,iBAAAA,SAA0BH,mBAiBJ,CAAA;EAWtBK;AAUjB;AAWA;EAIYG,IAAAA,EAAAA,OAjDKN,yBAiDc;EAAGE;;;;AAAgG;AAOlI;EAwEwBM,IAAAA,EAAAA,OAzHPT,yBAyH+BQ;;;;;;UAnH/BL,sBAAAA;;;;;;;;;;;UAWAC,uBAAAA;;;;;;;;;;UAUAC,oBAAAA;;;;;;;;;;;UAWAC,sBAAAA;;;;KAILC,mBAAAA,GAAsBJ,yBAAyBC,0BAA0BC,uBAAuBC;;;;;;;UAO3FE,wBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiCHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCUE,aAAAA,WAAwBD,2BAA2BN"}
1
+ {"version":3,"file":"live_search.d.cts","names":[],"sources":["../../src/tools/live_search.ts"],"mappings":";;;;;AAKA;cAAa,yBAAA;AAAA,cACA,yBAAA;;;AAAb;;UAMiB,iBAAA,SAA0B,mBAAA;EANL;;AAMtC;EAIE,IAAA,SAAa,yBAAA;;;;;;;EAOb,IAAA,SAAa,yBAAA;AAAA;;;;;UAOE,sBAAA;EACf,IAAA;EACA,OAAA;EACA,gBAAA;EACA,eAAA;EACA,UAAA;AAAA;;;;;UAOe,uBAAA;EACf,IAAA;EACA,OAAA;EACA,gBAAA;EACA,UAAA;AAAA;;;;;UAOe,oBAAA;EACf,IAAA;EACA,gBAAA;EACA,gBAAA;EACA,iBAAA;EACA,aAAA;AAAA;;;;;UAOe,sBAAA;EACf,IAAA;EACA,KAAA;AAAA;AAAA,KAGU,mBAAA,GACR,sBAAA,GACA,uBAAA,GACA,oBAAA,GACA,sBAAA;;AAJJ;;;;;UAYiB,wBAAA;EARb;;;;;;EAeF,IAAA;EAfwB;;AAQ1B;;EAYE,gBAAA;EAqB6B;;;;EAhB7B,QAAA;EAUA;;;;EALA,MAAA;EA4Gc;;;;EAvGd,eAAA;EAwGA;;;;;EAlGA,OAAA,GAAU,mBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiGI,aAAA,CACd,OAAA,GAAS,wBAAA,GACR,iBAAA"}
@@ -1,7 +1,6 @@
1
1
  import { XAISearchParameters } from "../live_search.js";
2
2
 
3
3
  //#region src/tools/live_search.d.ts
4
-
5
4
  /**
6
5
  * xAI's deprecated live_search tool type.
7
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"live_search.d.ts","names":["XAISearchParameters","XAI_LIVE_SEARCH_TOOL_TYPE","XAI_LIVE_SEARCH_TOOL_NAME","XAILiveSearchTool","XAIWebSearchToolSource","XAINewsSearchToolSource","XAIXSearchToolSource","XAIRssSearchToolSource","XAISearchToolSource","XAILiveSearchToolOptions","xaiLiveSearch"],"sources":["../../src/tools/live_search.d.ts"],"sourcesContent":["import type { XAISearchParameters } from \"../live_search.js\";\n/**\n * xAI's deprecated live_search tool type.\n */\nexport declare const XAI_LIVE_SEARCH_TOOL_TYPE = \"live_search_deprecated_20251215\";\nexport declare const XAI_LIVE_SEARCH_TOOL_NAME = \"live_search\";\n/**\n * xAI's built-in live_search tool type.\n * Enables the model to search the web for real-time information.\n */\nexport interface XAILiveSearchTool extends XAISearchParameters {\n /**\n * The name of the tool. Must be \"live_search\" for xAI's built-in search.\n */\n name: typeof XAI_LIVE_SEARCH_TOOL_NAME;\n /**\n * The type of the tool. This uses a deprecated Live Search API shape:\n * the advanced agentic search capabilities powering grok.com are generally\n * available in the new agentic tool calling API, and the Live Search API\n * will be deprecated by December 15, 2025.\n */\n type: typeof XAI_LIVE_SEARCH_TOOL_TYPE;\n}\n/**\n * Web search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIWebSource` internally.\n */\nexport interface XAIWebSearchToolSource {\n type: \"web\";\n country?: string;\n excludedWebsites?: string[];\n allowedWebsites?: string[];\n safeSearch?: boolean;\n}\n/**\n * News search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAINewsSource` internally.\n */\nexport interface XAINewsSearchToolSource {\n type: \"news\";\n country?: string;\n excludedWebsites?: string[];\n safeSearch?: boolean;\n}\n/**\n * X (formerly Twitter) search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIXSource` internally.\n */\nexport interface XAIXSearchToolSource {\n type: \"x\";\n includedXHandles?: string[];\n excludedXHandles?: string[];\n postFavoriteCount?: number;\n postViewCount?: number;\n}\n/**\n * RSS feed search source configuration for the xAI live search tool.\n * The structure matches `XAIRssSource` (only `links`).\n */\nexport interface XAIRssSearchToolSource {\n type: \"rss\";\n links: string[];\n}\nexport type XAISearchToolSource = XAIWebSearchToolSource | XAINewsSearchToolSource | XAIXSearchToolSource | XAIRssSearchToolSource;\n/**\n * Options for the xAI live 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 underlying `XAISearchParameters`\n * object that is sent to xAI's deprecated Live Search API.\n */\nexport interface XAILiveSearchToolOptions {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n maxSearchResults?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n fromDate?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n toDate?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n returnCitations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * These are converted to the snake_case `XAISearchSource` structures\n * used by the underlying xAI Live Search API.\n */\n sources?: XAISearchToolSource[];\n}\n/**\n * Creates an xAI built-in live search tool.\n * Enables the model to search the web for real-time information.\n *\n * This tool is executed server-side by the xAI API.\n *\n * @deprecated The Live Search API was deprecated by xAI on December 15, 2025.\n * Use the new agentic tool calling API instead with `xaiWebSearch()` and `xaiXSearch()`.\n *\n * @example Migration to new tools:\n * ```typescript\n * // Old (deprecated):\n * const searchTool = tools.xaiLiveSearch({ maxSearchResults: 5 });\n *\n * // New (recommended):\n * const webSearch = tools.xaiWebSearch({ allowedDomains: [\"example.com\"] });\n * const xSearch = tools.xaiXSearch({ allowedXHandles: [\"elonmusk\"] });\n * ```\n *\n * @example\n * ```typescript\n * import { ChatXAI, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * });\n *\n * const searchTool = tools.xaiLiveSearch({\n * maxSearchResults: 5,\n * fromDate: \"2024-01-01\",\n * returnCitations: true\n * });\n *\n * const llmWithSearch = llm.bindTools([searchTool]);\n * const result = await llmWithSearch.invoke(\"What happened in tech today?\");\n * ```\n */\nexport declare function xaiLiveSearch(options?: XAILiveSearchToolOptions): XAILiveSearchTool;\n//# sourceMappingURL=live_search.d.ts.map"],"mappings":";;;;;;AAIA;AACqBE,cADAD,yBAAAA,GACyB,iCAAA;AAK7BE,cALID,yBAAAA,GAKa,aAAA;;;;AAA4B;AAiB7CE,UAjBAD,iBAAAA,SAA0BH,mBAiBJ,CAAA;EAWtBK;AAUjB;AAWA;EAIYG,IAAAA,EAAAA,OAjDKN,yBAiDc;EAAGE;;;;AAAgG;AAOlI;EAwEwBM,IAAAA,EAAAA,OAzHPT,yBAyH+BQ;;;;;;UAnH/BL,sBAAAA;;;;;;;;;;;UAWAC,uBAAAA;;;;;;;;;;UAUAC,oBAAAA;;;;;;;;;;;UAWAC,sBAAAA;;;;KAILC,mBAAAA,GAAsBJ,yBAAyBC,0BAA0BC,uBAAuBC;;;;;;;UAO3FE,wBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiCHD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuCUE,aAAAA,WAAwBD,2BAA2BN"}
1
+ {"version":3,"file":"live_search.d.ts","names":[],"sources":["../../src/tools/live_search.ts"],"mappings":";;;;;AAKA;cAAa,yBAAA;AAAA,cACA,yBAAA;;;AAAb;;UAMiB,iBAAA,SAA0B,mBAAA;EANL;;AAMtC;EAIE,IAAA,SAAa,yBAAA;;;;;;;EAOb,IAAA,SAAa,yBAAA;AAAA;;;;;UAOE,sBAAA;EACf,IAAA;EACA,OAAA;EACA,gBAAA;EACA,eAAA;EACA,UAAA;AAAA;;;;;UAOe,uBAAA;EACf,IAAA;EACA,OAAA;EACA,gBAAA;EACA,UAAA;AAAA;;;;;UAOe,oBAAA;EACf,IAAA;EACA,gBAAA;EACA,gBAAA;EACA,iBAAA;EACA,aAAA;AAAA;;;;;UAOe,sBAAA;EACf,IAAA;EACA,KAAA;AAAA;AAAA,KAGU,mBAAA,GACR,sBAAA,GACA,uBAAA,GACA,oBAAA,GACA,sBAAA;;AAJJ;;;;;UAYiB,wBAAA;EARb;;;;;;EAeF,IAAA;EAfwB;;AAQ1B;;EAYE,gBAAA;EAqB6B;;;;EAhB7B,QAAA;EAUA;;;;EALA,MAAA;EA4Gc;;;;EAvGd,eAAA;EAwGA;;;;;EAlGA,OAAA,GAAU,mBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiGI,aAAA,CACd,OAAA,GAAS,wBAAA,GACR,iBAAA"}
@@ -30,10 +30,7 @@ function mapToolSourceToSearchSource(source) {
30
30
  type: "rss",
31
31
  links: source.links
32
32
  };
33
- default: {
34
- const _exhaustive = source;
35
- return _exhaustive;
36
- }
33
+ default: return source;
37
34
  }
38
35
  }
39
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"live_search.js","names":["source: XAISearchToolSource","_exhaustive: never","options: XAILiveSearchToolOptions"],"sources":["../../src/tools/live_search.ts"],"sourcesContent":["import type { XAISearchParameters, XAISearchSource } from \"../live_search.js\";\n\n/**\n * xAI's deprecated live_search tool type.\n */\nexport const XAI_LIVE_SEARCH_TOOL_TYPE = \"live_search_deprecated_20251215\";\nexport const XAI_LIVE_SEARCH_TOOL_NAME = \"live_search\";\n\n/**\n * xAI's built-in live_search tool type.\n * Enables the model to search the web for real-time information.\n */\nexport interface XAILiveSearchTool extends XAISearchParameters {\n /**\n * The name of the tool. Must be \"live_search\" for xAI's built-in search.\n */\n name: typeof XAI_LIVE_SEARCH_TOOL_NAME;\n /**\n * The type of the tool. This uses a deprecated Live Search API shape:\n * the advanced agentic search capabilities powering grok.com are generally\n * available in the new agentic tool calling API, and the Live Search API\n * will be deprecated by December 15, 2025.\n */\n type: typeof XAI_LIVE_SEARCH_TOOL_TYPE;\n}\n\n/**\n * Web search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIWebSource` internally.\n */\nexport interface XAIWebSearchToolSource {\n type: \"web\";\n country?: string;\n excludedWebsites?: string[];\n allowedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * News search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAINewsSource` internally.\n */\nexport interface XAINewsSearchToolSource {\n type: \"news\";\n country?: string;\n excludedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * X (formerly Twitter) search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIXSource` internally.\n */\nexport interface XAIXSearchToolSource {\n type: \"x\";\n includedXHandles?: string[];\n excludedXHandles?: string[];\n postFavoriteCount?: number;\n postViewCount?: number;\n}\n\n/**\n * RSS feed search source configuration for the xAI live search tool.\n * The structure matches `XAIRssSource` (only `links`).\n */\nexport interface XAIRssSearchToolSource {\n type: \"rss\";\n links: string[];\n}\n\nexport type XAISearchToolSource =\n | XAIWebSearchToolSource\n | XAINewsSearchToolSource\n | XAIXSearchToolSource\n | XAIRssSearchToolSource;\n\n/**\n * Options for the xAI live 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 underlying `XAISearchParameters`\n * object that is sent to xAI's deprecated Live Search API.\n */\nexport interface XAILiveSearchToolOptions {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n maxSearchResults?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n fromDate?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n toDate?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n returnCitations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * These are converted to the snake_case `XAISearchSource` structures\n * used by the underlying xAI Live Search API.\n */\n sources?: XAISearchToolSource[];\n}\n\nfunction mapToolSourceToSearchSource(\n source: XAISearchToolSource\n): XAISearchSource {\n switch (source.type) {\n case \"web\":\n return {\n type: \"web\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.allowedWebsites !== undefined && {\n allowed_websites: source.allowedWebsites,\n }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"news\":\n return {\n type: \"news\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"x\":\n return {\n type: \"x\",\n ...(source.includedXHandles !== undefined && {\n included_x_handles: source.includedXHandles,\n }),\n ...(source.excludedXHandles !== undefined && {\n excluded_x_handles: source.excludedXHandles,\n }),\n ...(source.postFavoriteCount !== undefined && {\n post_favorite_count: source.postFavoriteCount,\n }),\n ...(source.postViewCount !== undefined && {\n post_view_count: source.postViewCount,\n }),\n };\n case \"rss\":\n return {\n type: \"rss\",\n links: source.links,\n };\n default: {\n const _exhaustive: never = source;\n return _exhaustive;\n }\n }\n}\n\n/**\n * Creates an xAI built-in live search tool.\n * Enables the model to search the web for real-time information.\n *\n * This tool is executed server-side by the xAI API.\n *\n * @deprecated The Live Search API was deprecated by xAI on December 15, 2025.\n * Use the new agentic tool calling API instead with `xaiWebSearch()` and `xaiXSearch()`.\n *\n * @example Migration to new tools:\n * ```typescript\n * // Old (deprecated):\n * const searchTool = tools.xaiLiveSearch({ maxSearchResults: 5 });\n *\n * // New (recommended):\n * const webSearch = tools.xaiWebSearch({ allowedDomains: [\"example.com\"] });\n * const xSearch = tools.xaiXSearch({ allowedXHandles: [\"elonmusk\"] });\n * ```\n *\n * @example\n * ```typescript\n * import { ChatXAI, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * });\n *\n * const searchTool = tools.xaiLiveSearch({\n * maxSearchResults: 5,\n * fromDate: \"2024-01-01\",\n * returnCitations: true\n * });\n *\n * const llmWithSearch = llm.bindTools([searchTool]);\n * const result = await llmWithSearch.invoke(\"What happened in tech today?\");\n * ```\n */\nexport function xaiLiveSearch(\n options: XAILiveSearchToolOptions = {}\n): XAILiveSearchTool {\n return {\n type: XAI_LIVE_SEARCH_TOOL_TYPE,\n name: XAI_LIVE_SEARCH_TOOL_NAME,\n mode: options?.mode,\n max_search_results: options?.maxSearchResults,\n from_date: options?.fromDate,\n to_date: options?.toDate,\n return_citations: options?.returnCitations,\n sources: options?.sources?.map(mapToolSourceToSearchSource),\n } satisfies XAILiveSearchTool;\n}\n"],"mappings":";;;;AAKA,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AAgHzC,SAAS,4BACPA,QACiB;AACjB,SAAQ,OAAO,MAAf;EACE,KAAK,MACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,QAAS;GAC/D,GAAI,OAAO,oBAAoB,UAAa,EAC1C,kBAAkB,OAAO,gBAC1B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,iBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,WACrB;EACF;EACH,KAAK,OACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,QAAS;GAC/D,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,iBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,WACrB;EACF;EACH,KAAK,IACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,iBAC5B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,iBAC5B;GACD,GAAI,OAAO,sBAAsB,UAAa,EAC5C,qBAAqB,OAAO,kBAC7B;GACD,GAAI,OAAO,kBAAkB,UAAa,EACxC,iBAAiB,OAAO,cACzB;EACF;EACH,KAAK,MACH,QAAO;GACL,MAAM;GACN,OAAO,OAAO;EACf;EACH,SAAS;GACP,MAAMC,cAAqB;AAC3B,UAAO;EACR;CACF;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCD,SAAgB,cACdC,UAAoC,CAAE,GACnB;AACnB,QAAO;EACL,MAAM;EACN,MAAM;EACN,MAAM,SAAS;EACf,oBAAoB,SAAS;EAC7B,WAAW,SAAS;EACpB,SAAS,SAAS;EAClB,kBAAkB,SAAS;EAC3B,SAAS,SAAS,SAAS,IAAI,4BAA4B;CAC5D;AACF"}
1
+ {"version":3,"file":"live_search.js","names":[],"sources":["../../src/tools/live_search.ts"],"sourcesContent":["import type { XAISearchParameters, XAISearchSource } from \"../live_search.js\";\n\n/**\n * xAI's deprecated live_search tool type.\n */\nexport const XAI_LIVE_SEARCH_TOOL_TYPE = \"live_search_deprecated_20251215\";\nexport const XAI_LIVE_SEARCH_TOOL_NAME = \"live_search\";\n\n/**\n * xAI's built-in live_search tool type.\n * Enables the model to search the web for real-time information.\n */\nexport interface XAILiveSearchTool extends XAISearchParameters {\n /**\n * The name of the tool. Must be \"live_search\" for xAI's built-in search.\n */\n name: typeof XAI_LIVE_SEARCH_TOOL_NAME;\n /**\n * The type of the tool. This uses a deprecated Live Search API shape:\n * the advanced agentic search capabilities powering grok.com are generally\n * available in the new agentic tool calling API, and the Live Search API\n * will be deprecated by December 15, 2025.\n */\n type: typeof XAI_LIVE_SEARCH_TOOL_TYPE;\n}\n\n/**\n * Web search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIWebSource` internally.\n */\nexport interface XAIWebSearchToolSource {\n type: \"web\";\n country?: string;\n excludedWebsites?: string[];\n allowedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * News search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAINewsSource` internally.\n */\nexport interface XAINewsSearchToolSource {\n type: \"news\";\n country?: string;\n excludedWebsites?: string[];\n safeSearch?: boolean;\n}\n\n/**\n * X (formerly Twitter) search source configuration for the xAI live search tool (camelCase).\n * This is converted to the snake_case `XAIXSource` internally.\n */\nexport interface XAIXSearchToolSource {\n type: \"x\";\n includedXHandles?: string[];\n excludedXHandles?: string[];\n postFavoriteCount?: number;\n postViewCount?: number;\n}\n\n/**\n * RSS feed search source configuration for the xAI live search tool.\n * The structure matches `XAIRssSource` (only `links`).\n */\nexport interface XAIRssSearchToolSource {\n type: \"rss\";\n links: string[];\n}\n\nexport type XAISearchToolSource =\n | XAIWebSearchToolSource\n | XAINewsSearchToolSource\n | XAIXSearchToolSource\n | XAIRssSearchToolSource;\n\n/**\n * Options for the xAI live 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 underlying `XAISearchParameters`\n * object that is sent to xAI's deprecated Live Search API.\n */\nexport interface XAILiveSearchToolOptions {\n /**\n * Controls when the model should perform a search.\n * - \"auto\": Let the model decide when to search (default)\n * - \"on\": Always search for every request\n * - \"off\": Never search\n */\n mode?: \"auto\" | \"on\" | \"off\";\n /**\n * Maximum number of search results to return.\n * @default 20\n */\n maxSearchResults?: number;\n /**\n * Filter search results to only include content from after this date.\n * Format: ISO 8601 date string (e.g., \"2024-01-01\")\n */\n fromDate?: string;\n /**\n * Filter search results to only include content from before this date.\n * Format: ISO 8601 date string (e.g., \"2024-12-31\")\n */\n toDate?: string;\n /**\n * Whether to return citations/sources for the search results.\n * @default true\n */\n returnCitations?: boolean;\n /**\n * Specific web/news/X/RSS sources that can be used for the search.\n * These are converted to the snake_case `XAISearchSource` structures\n * used by the underlying xAI Live Search API.\n */\n sources?: XAISearchToolSource[];\n}\n\nfunction mapToolSourceToSearchSource(\n source: XAISearchToolSource\n): XAISearchSource {\n switch (source.type) {\n case \"web\":\n return {\n type: \"web\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.allowedWebsites !== undefined && {\n allowed_websites: source.allowedWebsites,\n }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"news\":\n return {\n type: \"news\",\n ...(source.country !== undefined && { country: source.country }),\n ...(source.excludedWebsites !== undefined && {\n excluded_websites: source.excludedWebsites,\n }),\n ...(source.safeSearch !== undefined && {\n safe_search: source.safeSearch,\n }),\n };\n case \"x\":\n return {\n type: \"x\",\n ...(source.includedXHandles !== undefined && {\n included_x_handles: source.includedXHandles,\n }),\n ...(source.excludedXHandles !== undefined && {\n excluded_x_handles: source.excludedXHandles,\n }),\n ...(source.postFavoriteCount !== undefined && {\n post_favorite_count: source.postFavoriteCount,\n }),\n ...(source.postViewCount !== undefined && {\n post_view_count: source.postViewCount,\n }),\n };\n case \"rss\":\n return {\n type: \"rss\",\n links: source.links,\n };\n default: {\n const _exhaustive: never = source;\n return _exhaustive;\n }\n }\n}\n\n/**\n * Creates an xAI built-in live search tool.\n * Enables the model to search the web for real-time information.\n *\n * This tool is executed server-side by the xAI API.\n *\n * @deprecated The Live Search API was deprecated by xAI on December 15, 2025.\n * Use the new agentic tool calling API instead with `xaiWebSearch()` and `xaiXSearch()`.\n *\n * @example Migration to new tools:\n * ```typescript\n * // Old (deprecated):\n * const searchTool = tools.xaiLiveSearch({ maxSearchResults: 5 });\n *\n * // New (recommended):\n * const webSearch = tools.xaiWebSearch({ allowedDomains: [\"example.com\"] });\n * const xSearch = tools.xaiXSearch({ allowedXHandles: [\"elonmusk\"] });\n * ```\n *\n * @example\n * ```typescript\n * import { ChatXAI, tools } from \"@langchain/xai\";\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * });\n *\n * const searchTool = tools.xaiLiveSearch({\n * maxSearchResults: 5,\n * fromDate: \"2024-01-01\",\n * returnCitations: true\n * });\n *\n * const llmWithSearch = llm.bindTools([searchTool]);\n * const result = await llmWithSearch.invoke(\"What happened in tech today?\");\n * ```\n */\nexport function xaiLiveSearch(\n options: XAILiveSearchToolOptions = {}\n): XAILiveSearchTool {\n return {\n type: XAI_LIVE_SEARCH_TOOL_TYPE,\n name: XAI_LIVE_SEARCH_TOOL_NAME,\n mode: options?.mode,\n max_search_results: options?.maxSearchResults,\n from_date: options?.fromDate,\n to_date: options?.toDate,\n return_citations: options?.returnCitations,\n sources: options?.sources?.map(mapToolSourceToSearchSource),\n } satisfies XAILiveSearchTool;\n}\n"],"mappings":";;;;AAKA,MAAa,4BAA4B;AACzC,MAAa,4BAA4B;AAgHzC,SAAS,4BACP,QACiB;AACjB,SAAQ,OAAO,MAAf;EACE,KAAK,MACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,SAAS;GAC/D,GAAI,OAAO,oBAAoB,UAAa,EAC1C,kBAAkB,OAAO,iBAC1B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,kBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,YACrB;GACF;EACH,KAAK,OACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,YAAY,UAAa,EAAE,SAAS,OAAO,SAAS;GAC/D,GAAI,OAAO,qBAAqB,UAAa,EAC3C,mBAAmB,OAAO,kBAC3B;GACD,GAAI,OAAO,eAAe,UAAa,EACrC,aAAa,OAAO,YACrB;GACF;EACH,KAAK,IACH,QAAO;GACL,MAAM;GACN,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,kBAC5B;GACD,GAAI,OAAO,qBAAqB,UAAa,EAC3C,oBAAoB,OAAO,kBAC5B;GACD,GAAI,OAAO,sBAAsB,UAAa,EAC5C,qBAAqB,OAAO,mBAC7B;GACD,GAAI,OAAO,kBAAkB,UAAa,EACxC,iBAAiB,OAAO,eACzB;GACF;EACH,KAAK,MACH,QAAO;GACL,MAAM;GACN,OAAO,OAAO;GACf;EACH,QAEE,QAD2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CjC,SAAgB,cACd,UAAoC,EAAE,EACnB;AACnB,QAAO;EACL,MAAM;EACN,MAAM;EACN,MAAM,SAAS;EACf,oBAAoB,SAAS;EAC7B,WAAW,SAAS;EACpB,SAAS,SAAS;EAClB,kBAAkB,SAAS;EAC3B,SAAS,SAAS,SAAS,IAAI,4BAA4B;EAC5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"web_search.cjs","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"}
1
+ {"version":3,"file":"web_search.cjs","names":[],"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,aACd,UAAmC,EAAE,EACnB;CAClB,MAAM,OAAyB,EAC7B,MAAM,0BACP;AAED,KAAI,QAAQ,mBAAmB,OAC7B,MAAK,kBAAkB,QAAQ;AAGjC,KAAI,QAAQ,oBAAoB,OAC9B,MAAK,mBAAmB,QAAQ;AAGlC,KAAI,QAAQ,6BAA6B,OACvC,MAAK,6BAA6B,QAAQ;AAG5C,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"web_search.d.cts","names":["XAI_WEB_SEARCH_TOOL_TYPE","XAIWebSearchTool","XAIWebSearchToolOptions","xaiWebSearch"],"sources":["../../src/tools/web_search.d.ts"],"sourcesContent":["/**\n * xAI Web Search tool type constant.\n */\nexport declare const XAI_WEB_SEARCH_TOOL_TYPE = \"web_search\";\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 * 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 * 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 declare function xaiWebSearch(options?: XAIWebSearchToolOptions): XAIWebSearchTool;\n//# sourceMappingURL=web_search.d.ts.map"],"mappings":";;AAGA;AAOA;AA0BiBE,cAjCIF,wBAAAA,GAiCmB,YAAA;AA+DxC;;;;;;UAzFiBC,gBAAAA;;;;eAIAD;;;;;;;;;;;;;;;;;;;;;;UAsBAE,uBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DOC,YAAAA,WAAuBD,0BAA0BD"}
1
+ {"version":3,"file":"web_search.d.cts","names":[],"sources":["../../src/tools/web_search.ts"],"mappings":";;AAGA;;cAAa,wBAAA;;;AAQb;;;;UAAiB,gBAAA;EAIF;;;EAAb,IAAA,SAAa,wBAAA;EAea;;AAQ5B;;EAlBE,eAAA;EAkBsC;;;;EAbtC,gBAAA;EAmCwB;AA0C1B;;;EAxEE,0BAAA;AAAA;;;;;;UAQe,uBAAA;;;;;;;EAOf,cAAA;;;;;;;EAOA,eAAA;;;;;;;;EAQA,wBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0Cc,YAAA,CACd,OAAA,GAAS,uBAAA,GACR,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"web_search.d.ts","names":["XAI_WEB_SEARCH_TOOL_TYPE","XAIWebSearchTool","XAIWebSearchToolOptions","xaiWebSearch"],"sources":["../../src/tools/web_search.d.ts"],"sourcesContent":["/**\n * xAI Web Search tool type constant.\n */\nexport declare const XAI_WEB_SEARCH_TOOL_TYPE = \"web_search\";\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 * 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 * 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 declare function xaiWebSearch(options?: XAIWebSearchToolOptions): XAIWebSearchTool;\n//# sourceMappingURL=web_search.d.ts.map"],"mappings":";;AAGA;AAOA;AA0BiBE,cAjCIF,wBAAAA,GAiCmB,YAAA;AA+DxC;;;;;;UAzFiBC,gBAAAA;;;;eAIAD;;;;;;;;;;;;;;;;;;;;;;UAsBAE,uBAAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA+DOC,YAAAA,WAAuBD,0BAA0BD"}
1
+ {"version":3,"file":"web_search.d.ts","names":[],"sources":["../../src/tools/web_search.ts"],"mappings":";;AAGA;;cAAa,wBAAA;;;AAQb;;;;UAAiB,gBAAA;EAIF;;;EAAb,IAAA,SAAa,wBAAA;EAea;;AAQ5B;;EAlBE,eAAA;EAkBsC;;;;EAbtC,gBAAA;EAmCwB;AA0C1B;;;EAxEE,0BAAA;AAAA;;;;;;UAQe,uBAAA;;;;;;;EAOf,cAAA;;;;;;;EAOA,eAAA;;;;;;;;EAQA,wBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0Cc,YAAA,CACd,OAAA,GAAS,uBAAA,GACR,gBAAA"}
@@ -1 +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"}
1
+ {"version":3,"file":"web_search.js","names":[],"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,aACd,UAAmC,EAAE,EACnB;CAClB,MAAM,OAAyB,EAC7B,MAAM,0BACP;AAED,KAAI,QAAQ,mBAAmB,OAC7B,MAAK,kBAAkB,QAAQ;AAGjC,KAAI,QAAQ,oBAAoB,OAC9B,MAAK,mBAAmB,QAAQ;AAGlC,KAAI,QAAQ,6BAA6B,OACvC,MAAK,6BAA6B,QAAQ;AAG5C,QAAO"}
@@ -1 +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"}
1
+ {"version":3,"file":"x_search.cjs","names":[],"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,WACd,UAAiC,EAAE,EACnB;CAChB,MAAM,OAAuB,EAC3B,MAAM,wBACP;AAED,KAAI,QAAQ,oBAAoB,OAC9B,MAAK,oBAAoB,QAAQ;AAGnC,KAAI,QAAQ,qBAAqB,OAC/B,MAAK,qBAAqB,QAAQ;AAGpC,KAAI,QAAQ,aAAa,OACvB,MAAK,YAAY,QAAQ;AAG3B,KAAI,QAAQ,WAAW,OACrB,MAAK,UAAU,QAAQ;AAGzB,KAAI,QAAQ,6BAA6B,OACvC,MAAK,6BAA6B,QAAQ;AAG5C,KAAI,QAAQ,6BAA6B,OACvC,MAAK,6BAA6B,QAAQ;AAG5C,QAAO"}
@@ -1 +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"}
1
+ {"version":3,"file":"x_search.d.cts","names":[],"sources":["../../src/tools/x_search.ts"],"mappings":";;AAGA;;cAAa,sBAAA;;;AASb;;;;;UAAiB,cAAA;EASf;;;EALA,IAAA,SAAa,sBAAA;EAyBb;;;;EApBA,iBAAA;EAiCoC;;;;EA5BpC,kBAAA;EAiDA;;;;EA5CA,SAAA;EAmEwB;AA6C1B;;;EA3GE,OAAA;EA4GS;;;;EAvGT,0BAAA;;;;;EAKA,0BAAA;AAAA;;;;;;UAQe,qBAAA;;;;;;;EAOf,eAAA;;;;;;;EAOA,gBAAA;;;;;;;EAOA,QAAA;;;;;;;EAOA,MAAA;;;;;;;;EAQA,wBAAA;;;;;;;;EAQA,wBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6Cc,UAAA,CACd,OAAA,GAAS,qBAAA,GACR,cAAA"}
@@ -1 +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"}
1
+ {"version":3,"file":"x_search.d.ts","names":[],"sources":["../../src/tools/x_search.ts"],"mappings":";;AAGA;;cAAa,sBAAA;;;AASb;;;;;UAAiB,cAAA;EASf;;;EALA,IAAA,SAAa,sBAAA;EAyBb;;;;EApBA,iBAAA;EAiCoC;;;;EA5BpC,kBAAA;EAiDA;;;;EA5CA,SAAA;EAmEwB;AA6C1B;;;EA3GE,OAAA;EA4GS;;;;EAvGT,0BAAA;;;;;EAKA,0BAAA;AAAA;;;;;;UAQe,qBAAA;;;;;;;EAOf,eAAA;;;;;;;EAOA,gBAAA;;;;;;;EAOA,QAAA;;;;;;;EAOA,MAAA;;;;;;;;EAQA,wBAAA;;;;;;;;EAQA,wBAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6Cc,UAAA,CACd,OAAA,GAAS,qBAAA,GACR,cAAA"}