@langchain/xai 1.3.8 → 1.3.9

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.
@@ -1 +1 @@
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
+ {"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-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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\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: true,\n },\n};\nexport default PROFILES;\n"],"mappings":";AAIA,MAAM,WAAyC;CAC7C,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,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"}
@@ -58,7 +58,7 @@ function mapToolSourceToSearchSource(source) {
58
58
  * import { ChatXAI, tools } from "@langchain/xai";
59
59
  *
60
60
  * const llm = new ChatXAI({
61
- * model: "grok-beta",
61
+ * model: "grok-3-fast",
62
62
  * });
63
63
  *
64
64
  * const searchTool = tools.xaiLiveSearch({
@@ -1 +1 @@
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
+ {"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-3-fast\",\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"}
@@ -129,7 +129,7 @@ interface XAILiveSearchToolOptions {
129
129
  * import { ChatXAI, tools } from "@langchain/xai";
130
130
  *
131
131
  * const llm = new ChatXAI({
132
- * model: "grok-beta",
132
+ * model: "grok-3-fast",
133
133
  * });
134
134
  *
135
135
  * const searchTool = tools.xaiLiveSearch({
@@ -129,7 +129,7 @@ interface XAILiveSearchToolOptions {
129
129
  * import { ChatXAI, tools } from "@langchain/xai";
130
130
  *
131
131
  * const llm = new ChatXAI({
132
- * model: "grok-beta",
132
+ * model: "grok-3-fast",
133
133
  * });
134
134
  *
135
135
  * const searchTool = tools.xaiLiveSearch({
@@ -57,7 +57,7 @@ function mapToolSourceToSearchSource(source) {
57
57
  * import { ChatXAI, tools } from "@langchain/xai";
58
58
  *
59
59
  * const llm = new ChatXAI({
60
- * model: "grok-beta",
60
+ * model: "grok-3-fast",
61
61
  * });
62
62
  *
63
63
  * const searchTool = tools.xaiLiveSearch({
@@ -1 +1 @@
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
+ {"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-3-fast\",\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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/xai",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "xAI integration for LangChain.js",
5
5
  "author": "LangChain",
6
6
  "license": "MIT",
@@ -12,9 +12,9 @@
12
12
  "type": "git",
13
13
  "url": "git@github.com:langchain-ai/langchainjs.git"
14
14
  },
15
- "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/langchain-xai/",
15
+ "homepage": "https://github.com/langchain-ai/langchainjs/tree/main/libs/providers/langchain-xai/",
16
16
  "dependencies": {
17
- "@langchain/openai": "1.2.12"
17
+ "@langchain/openai": "1.2.13"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@langchain/core": "^1.0.0"
@@ -30,10 +30,10 @@
30
30
  "typescript": "~5.8.3",
31
31
  "vitest": "^3.2.4",
32
32
  "zod": "^3.25.76",
33
- "@langchain/core": "^1.1.30",
34
- "@langchain/eslint": "0.1.1",
35
- "@langchain/openai": "^1.2.12",
33
+ "@langchain/openai": "^1.2.13",
36
34
  "@langchain/standard-tests": "0.0.23",
35
+ "@langchain/eslint": "0.1.1",
36
+ "@langchain/core": "^1.1.32",
37
37
  "@langchain/tsconfig": "0.0.1"
38
38
  },
39
39
  "publishConfig": {