@langchain/xai 0.1.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat_models.js","names":["fields?: Partial<ChatXAIInput>","options: this[\"ParsedCallOptions\"]","request:\n | OpenAIClient.Chat.ChatCompletionCreateParamsStreaming\n | OpenAIClient.Chat.ChatCompletionCreateParamsNonStreaming","options?: OpenAICoreRequestOptions","delta: Record<string, any>","rawResponse: OpenAIClient.ChatCompletionChunk","defaultRole?:\n | \"function\"\n | \"user\"\n | \"system\"\n | \"developer\"\n | \"assistant\"\n | \"tool\"","messageChunk: AIMessageChunk","message: OpenAIClient.ChatCompletionMessage","rawResponse: OpenAIClient.ChatCompletion","PROFILES","outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>","config?: StructuredOutputMethodOptions<boolean>"],"sources":["../src/chat_models.ts"],"sourcesContent":["import {\n BaseLanguageModelInput,\n StructuredOutputMethodOptions,\n} from \"@langchain/core/language_models/base\";\nimport {\n BaseChatModelCallOptions,\n BindToolsInput,\n LangSmithParams,\n type BaseChatModelParams,\n} from \"@langchain/core/language_models/chat_models\";\nimport { ModelProfile } from \"@langchain/core/language_models/profile\";\nimport { Serialized } from \"@langchain/core/load/serializable\";\nimport { AIMessageChunk, BaseMessage } from \"@langchain/core/messages\";\nimport { Runnable } from \"@langchain/core/runnables\";\nimport { getEnvironmentVariable } from \"@langchain/core/utils/env\";\nimport { InteropZodType } from \"@langchain/core/utils/types\";\nimport {\n type OpenAICoreRequestOptions,\n type OpenAIClient,\n OpenAIToolChoice,\n ChatOpenAICompletions,\n} from \"@langchain/openai\";\nimport PROFILES from \"./profiles.js\";\n\ntype ChatXAIToolType = BindToolsInput | OpenAIClient.ChatCompletionTool;\n\nexport interface ChatXAICallOptions extends BaseChatModelCallOptions {\n headers?: Record<string, string>;\n tools?: ChatXAIToolType[];\n tool_choice?: OpenAIToolChoice | string | \"auto\" | \"any\";\n}\n\nexport interface ChatXAIInput extends BaseChatModelParams {\n /**\n * The xAI API key to use for requests.\n * @default process.env.XAI_API_KEY\n */\n apiKey?: string;\n /**\n * The name of the model to use.\n * @default \"grok-beta\"\n */\n model?: string;\n /**\n * Up to 4 sequences where the API will stop generating further tokens. The\n * returned text will not contain the stop sequence.\n * Alias for `stopSequences`\n */\n stop?: Array<string>;\n /**\n * Up to 4 sequences where the API will stop generating further tokens. The\n * returned text will not contain the stop sequence.\n */\n stopSequences?: Array<string>;\n /**\n * Whether or not to stream responses.\n */\n streaming?: boolean;\n /**\n * The temperature to use for sampling.\n * @default 0.7\n */\n temperature?: number;\n /**\n * The maximum number of tokens that the model can process in a single response.\n * This limits ensures computational efficiency and resource management.\n */\n maxTokens?: number;\n}\n\n/**\n * xAI chat model integration.\n *\n * The xAI API is compatible to the OpenAI API with some limitations.\n *\n * Setup:\n * Install `@langchain/xai` and set an environment variable named `XAI_API_KEY`.\n *\n * ```bash\n * npm install @langchain/xai\n * export XAI_API_KEY=\"your-api-key\"\n * ```\n *\n * ## [Constructor args](https://api.js.langchain.com/classes/_langchain_xai.ChatXAI.html#constructor)\n *\n * ## [Runtime args](https://api.js.langchain.com/interfaces/_langchain_xai.ChatXAICallOptions.html)\n *\n * Runtime args can be passed as the second argument to any of the base runnable methods `.invoke`. `.stream`, `.batch`, etc.\n * They can also be passed via `.withConfig`, or the second arg in `.bindTools`, like shown in the examples below:\n *\n * ```typescript\n * // When calling `.withConfig`, call options should be passed via the first argument\n * const llmWithArgsBound = llm.withConfig({\n * stop: [\"\\n\"],\n * tools: [...],\n * });\n *\n * // When calling `.bindTools`, call options should be passed via the second argument\n * const llmWithTools = llm.bindTools(\n * [...],\n * {\n * tool_choice: \"auto\",\n * }\n * );\n * ```\n *\n * ## Examples\n *\n * <details open>\n * <summary><strong>Instantiate</strong></summary>\n *\n * ```typescript\n * import { ChatXAI } from '@langchain/xai';\n *\n * const llm = new ChatXAI({\n * model: \"grok-beta\",\n * temperature: 0,\n * // other params...\n * });\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Invoking</strong></summary>\n *\n * ```typescript\n * const input = `Translate \"I love programming\" into French.`;\n *\n * // Models also accept a list of chat messages or a formatted prompt\n * const result = await llm.invoke(input);\n * console.log(result);\n * ```\n *\n * ```txt\n * AIMessage {\n * \"content\": \"The French translation of \\\"I love programming\\\" is \\\"J'aime programmer\\\". In this sentence, \\\"J'aime\\\" is the first person singular conjugation of the French verb \\\"aimer\\\" which means \\\"to love\\\", and \\\"programmer\\\" is the French infinitive for \\\"to program\\\". I hope this helps! Let me know if you have any other questions.\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"tokenUsage\": {\n * \"completionTokens\": 82,\n * \"promptTokens\": 20,\n * \"totalTokens\": 102\n * },\n * \"finish_reason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Streaming Chunks</strong></summary>\n *\n * ```typescript\n * for await (const chunk of await llm.stream(input)) {\n * console.log(chunk);\n * }\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"The\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" French\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" translation\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" of\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" \\\"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"I\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \" love\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ...\n * AIMessageChunk {\n * \"content\": \".\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": null\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * AIMessageChunk {\n * \"content\": \"\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Aggregate Streamed Chunks</strong></summary>\n *\n * ```typescript\n * import { AIMessageChunk } from '@langchain/core/messages';\n * import { concat } from '@langchain/core/utils/stream';\n *\n * const stream = await llm.stream(input);\n * let full: AIMessageChunk | undefined;\n * for await (const chunk of stream) {\n * full = !full ? chunk : concat(full, chunk);\n * }\n * console.log(full);\n * ```\n *\n * ```txt\n * AIMessageChunk {\n * \"content\": \"The French translation of \\\"I love programming\\\" is \\\"J'aime programmer\\\". In this sentence, \\\"J'aime\\\" is the first person singular conjugation of the French verb \\\"aimer\\\" which means \\\"to love\\\", and \\\"programmer\\\" is the French infinitive for \\\"to program\\\". I hope this helps! Let me know if you have any other questions.\",\n * \"additional_kwargs\": {},\n * \"response_metadata\": {\n * \"finishReason\": \"stop\"\n * },\n * \"tool_calls\": [],\n * \"tool_call_chunks\": [],\n * \"invalid_tool_calls\": []\n * }\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Bind tools</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const llmForToolCalling = new ChatXAI({\n * model: \"grok-beta\",\n * temperature: 0,\n * // other params...\n * });\n *\n * const GetWeather = {\n * name: \"GetWeather\",\n * description: \"Get the current weather in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const GetPopulation = {\n * name: \"GetPopulation\",\n * description: \"Get the current population in a given location\",\n * schema: z.object({\n * location: z.string().describe(\"The city and state, e.g. San Francisco, CA\")\n * }),\n * }\n *\n * const llmWithTools = llmForToolCalling.bindTools([GetWeather, GetPopulation]);\n * const aiMsg = await llmWithTools.invoke(\n * \"Which city is hotter today and which is bigger: LA or NY?\"\n * );\n * console.log(aiMsg.tool_calls);\n * ```\n *\n * ```txt\n * [\n * {\n * name: 'GetWeather',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_cd34'\n * },\n * {\n * name: 'GetWeather',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_68rf'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'Los Angeles, CA' },\n * type: 'tool_call',\n * id: 'call_f81z'\n * },\n * {\n * name: 'GetPopulation',\n * args: { location: 'New York, NY' },\n * type: 'tool_call',\n * id: 'call_8byt'\n * }\n * ]\n * ```\n * </details>\n *\n * <br />\n *\n * <details>\n * <summary><strong>Structured Output</strong></summary>\n *\n * ```typescript\n * import { z } from 'zod';\n *\n * const Joke = z.object({\n * setup: z.string().describe(\"The setup of the joke\"),\n * punchline: z.string().describe(\"The punchline to the joke\"),\n * rating: z.number().optional().describe(\"How funny the joke is, from 1 to 10\")\n * }).describe('Joke to tell user.');\n *\n * const structuredLlm = llmForToolCalling.withStructuredOutput(Joke, { name: \"Joke\" });\n * const jokeResult = await structuredLlm.invoke(\"Tell me a joke about cats\");\n * console.log(jokeResult);\n * ```\n *\n * ```txt\n * {\n * setup: \"Why don't cats play poker in the wild?\",\n * punchline: 'Because there are too many cheetahs.'\n * }\n * ```\n * </details>\n *\n * <br />\n */\nexport class ChatXAI extends ChatOpenAICompletions<ChatXAICallOptions> {\n static lc_name() {\n return \"ChatXAI\";\n }\n\n _llmType() {\n return \"xai\";\n }\n\n get lc_secrets(): { [key: string]: string } | undefined {\n return {\n apiKey: \"XAI_API_KEY\",\n };\n }\n\n lc_serializable = true;\n\n lc_namespace = [\"langchain\", \"chat_models\", \"xai\"];\n\n constructor(fields?: Partial<ChatXAIInput>) {\n const apiKey = fields?.apiKey || getEnvironmentVariable(\"XAI_API_KEY\");\n if (!apiKey) {\n throw new Error(\n `xAI API key not found. Please set the XAI_API_KEY environment variable or provide the key into \"apiKey\" field.`\n );\n }\n\n super({\n ...fields,\n model: fields?.model || \"grok-beta\",\n apiKey,\n configuration: {\n baseURL: \"https://api.x.ai/v1\",\n },\n });\n }\n\n toJSON(): Serialized {\n const result = super.toJSON();\n\n if (\n \"kwargs\" in result &&\n typeof result.kwargs === \"object\" &&\n result.kwargs != null\n ) {\n delete result.kwargs.openai_api_key;\n delete result.kwargs.configuration;\n }\n\n return result;\n }\n\n getLsParams(options: this[\"ParsedCallOptions\"]): LangSmithParams {\n const params = super.getLsParams(options);\n params.ls_provider = \"xai\";\n return params;\n }\n\n async completionWithRetry(\n request: OpenAIClient.Chat.ChatCompletionCreateParamsStreaming,\n options?: OpenAICoreRequestOptions\n ): Promise<AsyncIterable<OpenAIClient.Chat.Completions.ChatCompletionChunk>>;\n\n async completionWithRetry(\n request: OpenAIClient.Chat.ChatCompletionCreateParamsNonStreaming,\n options?: OpenAICoreRequestOptions\n ): Promise<OpenAIClient.Chat.Completions.ChatCompletion>;\n\n /**\n * Calls the xAI API with retry logic in case of failures.\n * @param request The request to send to the xAI API.\n * @param options Optional configuration for the API call.\n * @returns The response from the xAI API.\n */\n async completionWithRetry(\n request:\n | OpenAIClient.Chat.ChatCompletionCreateParamsStreaming\n | OpenAIClient.Chat.ChatCompletionCreateParamsNonStreaming,\n options?: OpenAICoreRequestOptions\n ): Promise<\n | AsyncIterable<OpenAIClient.Chat.Completions.ChatCompletionChunk>\n | OpenAIClient.Chat.Completions.ChatCompletion\n > {\n delete request.frequency_penalty;\n delete request.presence_penalty;\n delete request.logit_bias;\n delete request.functions;\n\n const newRequestMessages = request.messages.map((msg) => {\n if (!msg.content) {\n return {\n ...msg,\n content: \"\",\n };\n }\n return msg;\n });\n\n const newRequest = {\n ...request,\n messages: newRequestMessages,\n };\n\n if (newRequest.stream === true) {\n return super.completionWithRetry(newRequest, options);\n }\n\n return super.completionWithRetry(newRequest, options);\n }\n\n protected override _convertCompletionsDeltaToBaseMessageChunk(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n delta: Record<string, any>,\n rawResponse: OpenAIClient.ChatCompletionChunk,\n defaultRole?:\n | \"function\"\n | \"user\"\n | \"system\"\n | \"developer\"\n | \"assistant\"\n | \"tool\"\n ) {\n const messageChunk: AIMessageChunk =\n super._convertCompletionsDeltaToBaseMessageChunk(\n delta,\n rawResponse,\n defaultRole\n );\n // Make concatenating chunks work without merge warning\n if (!rawResponse.choices[0]?.finish_reason) {\n delete messageChunk.response_metadata.usage;\n delete messageChunk.usage_metadata;\n } else {\n messageChunk.usage_metadata = messageChunk.response_metadata.usage;\n }\n return messageChunk;\n }\n\n protected override _convertCompletionsMessageToBaseMessage(\n message: OpenAIClient.ChatCompletionMessage,\n rawResponse: OpenAIClient.ChatCompletion\n ) {\n const langChainMessage = super._convertCompletionsMessageToBaseMessage(\n message,\n rawResponse\n );\n langChainMessage.additional_kwargs.reasoning_content =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (message as any).reasoning_content;\n return langChainMessage;\n }\n\n /**\n * Return profiling information for the model.\n *\n * Provides information about the model's capabilities and constraints,\n * including token limits, multimodal support, and advanced features like\n * tool calling and structured output.\n *\n * @returns {ModelProfile} An object describing the model's capabilities and constraints\n *\n * @example\n * ```typescript\n * const model = new ChatXAI({ model: \"grok-beta\" });\n * const profile = model.profile;\n * console.log(profile.maxInputTokens); // 128000\n * console.log(profile.imageInputs); // true\n * ```\n */\n get profile(): ModelProfile {\n return PROFILES[this.model] ?? {};\n }\n\n override withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<false>\n ): Runnable<BaseLanguageModelInput, RunOutput>;\n\n override withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<true>\n ): Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n override withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }>;\n\n override withStructuredOutput<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>\n >(\n outputSchema:\n | InteropZodType<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n config?: StructuredOutputMethodOptions<boolean>\n ):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n > {\n const ensuredConfig = { ...config };\n if (ensuredConfig?.method === undefined) {\n ensuredConfig.method = \"functionCalling\";\n }\n return super.withStructuredOutput<RunOutput>(outputSchema, ensuredConfig);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4YA,IAAa,UAAb,cAA6B,sBAA0C;CACrE,OAAO,UAAU;AACf,SAAO;CACR;CAED,WAAW;AACT,SAAO;CACR;CAED,IAAI,aAAoD;AACtD,SAAO,EACL,QAAQ,cACT;CACF;CAED,kBAAkB;CAElB,eAAe;EAAC;EAAa;EAAe;CAAM;CAElD,YAAYA,QAAgC;EAC1C,MAAM,SAAS,QAAQ,UAAU,uBAAuB,cAAc;AACtE,MAAI,CAAC,OACH,OAAM,IAAI,MACR,CAAC,8GAA8G,CAAC;EAIpH,MAAM;GACJ,GAAG;GACH,OAAO,QAAQ,SAAS;GACxB;GACA,eAAe,EACb,SAAS,sBACV;EACF,EAAC;CACH;CAED,SAAqB;EACnB,MAAM,SAAS,MAAM,QAAQ;AAE7B,MACE,YAAY,UACZ,OAAO,OAAO,WAAW,YACzB,OAAO,UAAU,MACjB;GACA,OAAO,OAAO,OAAO;GACrB,OAAO,OAAO,OAAO;EACtB;AAED,SAAO;CACR;CAED,YAAYC,SAAqD;EAC/D,MAAM,SAAS,MAAM,YAAY,QAAQ;EACzC,OAAO,cAAc;AACrB,SAAO;CACR;;;;;;;CAkBD,MAAM,oBACJC,SAGAC,SAIA;EACA,OAAO,QAAQ;EACf,OAAO,QAAQ;EACf,OAAO,QAAQ;EACf,OAAO,QAAQ;EAEf,MAAM,qBAAqB,QAAQ,SAAS,IAAI,CAAC,QAAQ;AACvD,OAAI,CAAC,IAAI,QACP,QAAO;IACL,GAAG;IACH,SAAS;GACV;AAEH,UAAO;EACR,EAAC;EAEF,MAAM,aAAa;GACjB,GAAG;GACH,UAAU;EACX;AAED,MAAI,WAAW,WAAW,KACxB,QAAO,MAAM,oBAAoB,YAAY,QAAQ;AAGvD,SAAO,MAAM,oBAAoB,YAAY,QAAQ;CACtD;CAED,AAAmB,2CAEjBC,OACAC,aACAC,aAOA;EACA,MAAMC,eACJ,MAAM,2CACJ,OACA,aACA,YACD;AAEH,MAAI,CAAC,YAAY,QAAQ,IAAI,eAAe;GAC1C,OAAO,aAAa,kBAAkB;GACtC,OAAO,aAAa;EACrB,OACC,aAAa,iBAAiB,aAAa,kBAAkB;AAE/D,SAAO;CACR;CAED,AAAmB,wCACjBC,SACAC,aACA;EACA,MAAM,mBAAmB,MAAM,wCAC7B,SACA,YACD;EACD,iBAAiB,kBAAkB,oBAEhC,QAAgB;AACnB,SAAO;CACR;;;;;;;;;;;;;;;;;;CAmBD,IAAI,UAAwB;AAC1B,SAAOC,iBAAS,KAAK,UAAU,CAAE;CAClC;CAqCD,AAAS,qBAIPC,cAIAC,QAMI;EACJ,MAAM,gBAAgB,EAAE,GAAG,OAAQ;AACnC,MAAI,eAAe,WAAW,QAC5B,cAAc,SAAS;AAEzB,SAAO,MAAM,qBAAgC,cAAc,cAAc;CAC1E;AACF"}
package/dist/index.cjs CHANGED
@@ -1,17 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./chat_models.cjs"), exports);
1
+ const require_chat_models = require('./chat_models.cjs');
2
+
3
+ exports.ChatXAI = require_chat_models.ChatXAI;
@@ -0,0 +1,2 @@
1
+ import { ChatXAI, ChatXAICallOptions, ChatXAIInput } from "./chat_models.cjs";
2
+ export { ChatXAI, ChatXAICallOptions, ChatXAIInput };
package/dist/index.d.ts CHANGED
@@ -1 +1,2 @@
1
- export * from "./chat_models.js";
1
+ import { ChatXAI, ChatXAICallOptions, ChatXAIInput } from "./chat_models.js";
2
+ export { ChatXAI, ChatXAICallOptions, ChatXAIInput };
package/dist/index.js CHANGED
@@ -1 +1,3 @@
1
- export * from "./chat_models.js";
1
+ import { ChatXAI } from "./chat_models.js";
2
+
3
+ export { ChatXAI };
@@ -0,0 +1,289 @@
1
+
2
+ //#region src/profiles.ts
3
+ const PROFILES = {
4
+ "grok-4-fast-non-reasoning": {
5
+ maxInputTokens: 2e6,
6
+ imageInputs: true,
7
+ audioInputs: false,
8
+ pdfInputs: false,
9
+ videoInputs: false,
10
+ maxOutputTokens: 3e4,
11
+ reasoningOutput: false,
12
+ imageOutputs: false,
13
+ audioOutputs: false,
14
+ videoOutputs: false,
15
+ toolCalling: true,
16
+ structuredOutput: false
17
+ },
18
+ "grok-3-fast": {
19
+ maxInputTokens: 131072,
20
+ imageInputs: false,
21
+ audioInputs: false,
22
+ pdfInputs: false,
23
+ videoInputs: false,
24
+ maxOutputTokens: 8192,
25
+ reasoningOutput: false,
26
+ imageOutputs: false,
27
+ audioOutputs: false,
28
+ videoOutputs: false,
29
+ toolCalling: true,
30
+ structuredOutput: false
31
+ },
32
+ "grok-4": {
33
+ maxInputTokens: 256e3,
34
+ imageInputs: false,
35
+ audioInputs: false,
36
+ pdfInputs: false,
37
+ videoInputs: false,
38
+ maxOutputTokens: 64e3,
39
+ reasoningOutput: true,
40
+ imageOutputs: false,
41
+ audioOutputs: false,
42
+ videoOutputs: false,
43
+ toolCalling: true,
44
+ structuredOutput: false
45
+ },
46
+ "grok-2-vision": {
47
+ maxInputTokens: 8192,
48
+ imageInputs: true,
49
+ audioInputs: false,
50
+ pdfInputs: false,
51
+ videoInputs: false,
52
+ maxOutputTokens: 4096,
53
+ reasoningOutput: false,
54
+ imageOutputs: false,
55
+ audioOutputs: false,
56
+ videoOutputs: false,
57
+ toolCalling: true,
58
+ structuredOutput: false
59
+ },
60
+ "grok-code-fast-1": {
61
+ maxInputTokens: 256e3,
62
+ imageInputs: false,
63
+ audioInputs: false,
64
+ pdfInputs: false,
65
+ videoInputs: false,
66
+ maxOutputTokens: 1e4,
67
+ reasoningOutput: true,
68
+ imageOutputs: false,
69
+ audioOutputs: false,
70
+ videoOutputs: false,
71
+ toolCalling: true,
72
+ structuredOutput: false
73
+ },
74
+ "grok-2": {
75
+ maxInputTokens: 131072,
76
+ imageInputs: false,
77
+ audioInputs: false,
78
+ pdfInputs: false,
79
+ videoInputs: false,
80
+ maxOutputTokens: 8192,
81
+ reasoningOutput: false,
82
+ imageOutputs: false,
83
+ audioOutputs: false,
84
+ videoOutputs: false,
85
+ toolCalling: true,
86
+ structuredOutput: false
87
+ },
88
+ "grok-3-mini-fast-latest": {
89
+ maxInputTokens: 131072,
90
+ imageInputs: false,
91
+ audioInputs: false,
92
+ pdfInputs: false,
93
+ videoInputs: false,
94
+ maxOutputTokens: 8192,
95
+ reasoningOutput: true,
96
+ imageOutputs: false,
97
+ audioOutputs: false,
98
+ videoOutputs: false,
99
+ toolCalling: true,
100
+ structuredOutput: false
101
+ },
102
+ "grok-2-vision-1212": {
103
+ maxInputTokens: 8192,
104
+ imageInputs: true,
105
+ audioInputs: false,
106
+ pdfInputs: false,
107
+ videoInputs: false,
108
+ maxOutputTokens: 4096,
109
+ reasoningOutput: false,
110
+ imageOutputs: false,
111
+ audioOutputs: false,
112
+ videoOutputs: false,
113
+ toolCalling: true,
114
+ structuredOutput: false
115
+ },
116
+ "grok-3": {
117
+ maxInputTokens: 131072,
118
+ imageInputs: false,
119
+ audioInputs: false,
120
+ pdfInputs: false,
121
+ videoInputs: false,
122
+ maxOutputTokens: 8192,
123
+ reasoningOutput: false,
124
+ imageOutputs: false,
125
+ audioOutputs: false,
126
+ videoOutputs: false,
127
+ toolCalling: true,
128
+ structuredOutput: false
129
+ },
130
+ "grok-4-fast": {
131
+ maxInputTokens: 2e6,
132
+ imageInputs: true,
133
+ audioInputs: false,
134
+ pdfInputs: false,
135
+ videoInputs: false,
136
+ maxOutputTokens: 3e4,
137
+ reasoningOutput: true,
138
+ imageOutputs: false,
139
+ audioOutputs: false,
140
+ videoOutputs: false,
141
+ toolCalling: true,
142
+ structuredOutput: false
143
+ },
144
+ "grok-2-latest": {
145
+ maxInputTokens: 131072,
146
+ imageInputs: false,
147
+ audioInputs: false,
148
+ pdfInputs: false,
149
+ videoInputs: false,
150
+ maxOutputTokens: 8192,
151
+ reasoningOutput: false,
152
+ imageOutputs: false,
153
+ audioOutputs: false,
154
+ videoOutputs: false,
155
+ toolCalling: true,
156
+ structuredOutput: false
157
+ },
158
+ "grok-2-1212": {
159
+ maxInputTokens: 131072,
160
+ imageInputs: false,
161
+ audioInputs: false,
162
+ pdfInputs: false,
163
+ videoInputs: false,
164
+ maxOutputTokens: 8192,
165
+ reasoningOutput: false,
166
+ imageOutputs: false,
167
+ audioOutputs: false,
168
+ videoOutputs: false,
169
+ toolCalling: true,
170
+ structuredOutput: false
171
+ },
172
+ "grok-3-fast-latest": {
173
+ maxInputTokens: 131072,
174
+ imageInputs: false,
175
+ audioInputs: false,
176
+ pdfInputs: false,
177
+ videoInputs: false,
178
+ maxOutputTokens: 8192,
179
+ reasoningOutput: false,
180
+ imageOutputs: false,
181
+ audioOutputs: false,
182
+ videoOutputs: false,
183
+ toolCalling: true,
184
+ structuredOutput: false
185
+ },
186
+ "grok-3-latest": {
187
+ maxInputTokens: 131072,
188
+ imageInputs: false,
189
+ audioInputs: false,
190
+ pdfInputs: false,
191
+ videoInputs: false,
192
+ maxOutputTokens: 8192,
193
+ reasoningOutput: false,
194
+ imageOutputs: false,
195
+ audioOutputs: false,
196
+ videoOutputs: false,
197
+ toolCalling: true,
198
+ structuredOutput: false
199
+ },
200
+ "grok-2-vision-latest": {
201
+ maxInputTokens: 8192,
202
+ imageInputs: true,
203
+ audioInputs: false,
204
+ pdfInputs: false,
205
+ videoInputs: false,
206
+ maxOutputTokens: 4096,
207
+ reasoningOutput: false,
208
+ imageOutputs: false,
209
+ audioOutputs: false,
210
+ videoOutputs: false,
211
+ toolCalling: true,
212
+ structuredOutput: false
213
+ },
214
+ "grok-vision-beta": {
215
+ maxInputTokens: 8192,
216
+ imageInputs: true,
217
+ audioInputs: false,
218
+ pdfInputs: false,
219
+ videoInputs: false,
220
+ maxOutputTokens: 4096,
221
+ reasoningOutput: false,
222
+ imageOutputs: false,
223
+ audioOutputs: false,
224
+ videoOutputs: false,
225
+ toolCalling: true,
226
+ structuredOutput: false
227
+ },
228
+ "grok-3-mini": {
229
+ maxInputTokens: 131072,
230
+ imageInputs: false,
231
+ audioInputs: false,
232
+ pdfInputs: false,
233
+ videoInputs: false,
234
+ maxOutputTokens: 8192,
235
+ reasoningOutput: true,
236
+ imageOutputs: false,
237
+ audioOutputs: false,
238
+ videoOutputs: false,
239
+ toolCalling: true,
240
+ structuredOutput: false
241
+ },
242
+ "grok-beta": {
243
+ maxInputTokens: 131072,
244
+ imageInputs: false,
245
+ audioInputs: false,
246
+ pdfInputs: false,
247
+ videoInputs: false,
248
+ maxOutputTokens: 4096,
249
+ reasoningOutput: false,
250
+ imageOutputs: false,
251
+ audioOutputs: false,
252
+ videoOutputs: false,
253
+ toolCalling: true,
254
+ structuredOutput: false
255
+ },
256
+ "grok-3-mini-latest": {
257
+ maxInputTokens: 131072,
258
+ imageInputs: false,
259
+ audioInputs: false,
260
+ pdfInputs: false,
261
+ videoInputs: false,
262
+ maxOutputTokens: 8192,
263
+ reasoningOutput: true,
264
+ imageOutputs: false,
265
+ audioOutputs: false,
266
+ videoOutputs: false,
267
+ toolCalling: true,
268
+ structuredOutput: false
269
+ },
270
+ "grok-3-mini-fast": {
271
+ maxInputTokens: 131072,
272
+ imageInputs: false,
273
+ audioInputs: false,
274
+ pdfInputs: false,
275
+ videoInputs: false,
276
+ maxOutputTokens: 8192,
277
+ reasoningOutput: true,
278
+ imageOutputs: false,
279
+ audioOutputs: false,
280
+ videoOutputs: false,
281
+ toolCalling: true,
282
+ structuredOutput: false
283
+ }
284
+ };
285
+ var profiles_default = PROFILES;
286
+
287
+ //#endregion
288
+ exports.default = profiles_default;
289
+ //# sourceMappingURL=profiles.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiles.cjs","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"}
@@ -0,0 +1,288 @@
1
+ //#region src/profiles.ts
2
+ const PROFILES = {
3
+ "grok-4-fast-non-reasoning": {
4
+ maxInputTokens: 2e6,
5
+ imageInputs: true,
6
+ audioInputs: false,
7
+ pdfInputs: false,
8
+ videoInputs: false,
9
+ maxOutputTokens: 3e4,
10
+ reasoningOutput: false,
11
+ imageOutputs: false,
12
+ audioOutputs: false,
13
+ videoOutputs: false,
14
+ toolCalling: true,
15
+ structuredOutput: false
16
+ },
17
+ "grok-3-fast": {
18
+ maxInputTokens: 131072,
19
+ imageInputs: false,
20
+ audioInputs: false,
21
+ pdfInputs: false,
22
+ videoInputs: false,
23
+ maxOutputTokens: 8192,
24
+ reasoningOutput: false,
25
+ imageOutputs: false,
26
+ audioOutputs: false,
27
+ videoOutputs: false,
28
+ toolCalling: true,
29
+ structuredOutput: false
30
+ },
31
+ "grok-4": {
32
+ maxInputTokens: 256e3,
33
+ imageInputs: false,
34
+ audioInputs: false,
35
+ pdfInputs: false,
36
+ videoInputs: false,
37
+ maxOutputTokens: 64e3,
38
+ reasoningOutput: true,
39
+ imageOutputs: false,
40
+ audioOutputs: false,
41
+ videoOutputs: false,
42
+ toolCalling: true,
43
+ structuredOutput: false
44
+ },
45
+ "grok-2-vision": {
46
+ maxInputTokens: 8192,
47
+ imageInputs: true,
48
+ audioInputs: false,
49
+ pdfInputs: false,
50
+ videoInputs: false,
51
+ maxOutputTokens: 4096,
52
+ reasoningOutput: false,
53
+ imageOutputs: false,
54
+ audioOutputs: false,
55
+ videoOutputs: false,
56
+ toolCalling: true,
57
+ structuredOutput: false
58
+ },
59
+ "grok-code-fast-1": {
60
+ maxInputTokens: 256e3,
61
+ imageInputs: false,
62
+ audioInputs: false,
63
+ pdfInputs: false,
64
+ videoInputs: false,
65
+ maxOutputTokens: 1e4,
66
+ reasoningOutput: true,
67
+ imageOutputs: false,
68
+ audioOutputs: false,
69
+ videoOutputs: false,
70
+ toolCalling: true,
71
+ structuredOutput: false
72
+ },
73
+ "grok-2": {
74
+ maxInputTokens: 131072,
75
+ imageInputs: false,
76
+ audioInputs: false,
77
+ pdfInputs: false,
78
+ videoInputs: false,
79
+ maxOutputTokens: 8192,
80
+ reasoningOutput: false,
81
+ imageOutputs: false,
82
+ audioOutputs: false,
83
+ videoOutputs: false,
84
+ toolCalling: true,
85
+ structuredOutput: false
86
+ },
87
+ "grok-3-mini-fast-latest": {
88
+ maxInputTokens: 131072,
89
+ imageInputs: false,
90
+ audioInputs: false,
91
+ pdfInputs: false,
92
+ videoInputs: false,
93
+ maxOutputTokens: 8192,
94
+ reasoningOutput: true,
95
+ imageOutputs: false,
96
+ audioOutputs: false,
97
+ videoOutputs: false,
98
+ toolCalling: true,
99
+ structuredOutput: false
100
+ },
101
+ "grok-2-vision-1212": {
102
+ maxInputTokens: 8192,
103
+ imageInputs: true,
104
+ audioInputs: false,
105
+ pdfInputs: false,
106
+ videoInputs: false,
107
+ maxOutputTokens: 4096,
108
+ reasoningOutput: false,
109
+ imageOutputs: false,
110
+ audioOutputs: false,
111
+ videoOutputs: false,
112
+ toolCalling: true,
113
+ structuredOutput: false
114
+ },
115
+ "grok-3": {
116
+ maxInputTokens: 131072,
117
+ imageInputs: false,
118
+ audioInputs: false,
119
+ pdfInputs: false,
120
+ videoInputs: false,
121
+ maxOutputTokens: 8192,
122
+ reasoningOutput: false,
123
+ imageOutputs: false,
124
+ audioOutputs: false,
125
+ videoOutputs: false,
126
+ toolCalling: true,
127
+ structuredOutput: false
128
+ },
129
+ "grok-4-fast": {
130
+ maxInputTokens: 2e6,
131
+ imageInputs: true,
132
+ audioInputs: false,
133
+ pdfInputs: false,
134
+ videoInputs: false,
135
+ maxOutputTokens: 3e4,
136
+ reasoningOutput: true,
137
+ imageOutputs: false,
138
+ audioOutputs: false,
139
+ videoOutputs: false,
140
+ toolCalling: true,
141
+ structuredOutput: false
142
+ },
143
+ "grok-2-latest": {
144
+ maxInputTokens: 131072,
145
+ imageInputs: false,
146
+ audioInputs: false,
147
+ pdfInputs: false,
148
+ videoInputs: false,
149
+ maxOutputTokens: 8192,
150
+ reasoningOutput: false,
151
+ imageOutputs: false,
152
+ audioOutputs: false,
153
+ videoOutputs: false,
154
+ toolCalling: true,
155
+ structuredOutput: false
156
+ },
157
+ "grok-2-1212": {
158
+ maxInputTokens: 131072,
159
+ imageInputs: false,
160
+ audioInputs: false,
161
+ pdfInputs: false,
162
+ videoInputs: false,
163
+ maxOutputTokens: 8192,
164
+ reasoningOutput: false,
165
+ imageOutputs: false,
166
+ audioOutputs: false,
167
+ videoOutputs: false,
168
+ toolCalling: true,
169
+ structuredOutput: false
170
+ },
171
+ "grok-3-fast-latest": {
172
+ maxInputTokens: 131072,
173
+ imageInputs: false,
174
+ audioInputs: false,
175
+ pdfInputs: false,
176
+ videoInputs: false,
177
+ maxOutputTokens: 8192,
178
+ reasoningOutput: false,
179
+ imageOutputs: false,
180
+ audioOutputs: false,
181
+ videoOutputs: false,
182
+ toolCalling: true,
183
+ structuredOutput: false
184
+ },
185
+ "grok-3-latest": {
186
+ maxInputTokens: 131072,
187
+ imageInputs: false,
188
+ audioInputs: false,
189
+ pdfInputs: false,
190
+ videoInputs: false,
191
+ maxOutputTokens: 8192,
192
+ reasoningOutput: false,
193
+ imageOutputs: false,
194
+ audioOutputs: false,
195
+ videoOutputs: false,
196
+ toolCalling: true,
197
+ structuredOutput: false
198
+ },
199
+ "grok-2-vision-latest": {
200
+ maxInputTokens: 8192,
201
+ imageInputs: true,
202
+ audioInputs: false,
203
+ pdfInputs: false,
204
+ videoInputs: false,
205
+ maxOutputTokens: 4096,
206
+ reasoningOutput: false,
207
+ imageOutputs: false,
208
+ audioOutputs: false,
209
+ videoOutputs: false,
210
+ toolCalling: true,
211
+ structuredOutput: false
212
+ },
213
+ "grok-vision-beta": {
214
+ maxInputTokens: 8192,
215
+ imageInputs: true,
216
+ audioInputs: false,
217
+ pdfInputs: false,
218
+ videoInputs: false,
219
+ maxOutputTokens: 4096,
220
+ reasoningOutput: false,
221
+ imageOutputs: false,
222
+ audioOutputs: false,
223
+ videoOutputs: false,
224
+ toolCalling: true,
225
+ structuredOutput: false
226
+ },
227
+ "grok-3-mini": {
228
+ maxInputTokens: 131072,
229
+ imageInputs: false,
230
+ audioInputs: false,
231
+ pdfInputs: false,
232
+ videoInputs: false,
233
+ maxOutputTokens: 8192,
234
+ reasoningOutput: true,
235
+ imageOutputs: false,
236
+ audioOutputs: false,
237
+ videoOutputs: false,
238
+ toolCalling: true,
239
+ structuredOutput: false
240
+ },
241
+ "grok-beta": {
242
+ maxInputTokens: 131072,
243
+ imageInputs: false,
244
+ audioInputs: false,
245
+ pdfInputs: false,
246
+ videoInputs: false,
247
+ maxOutputTokens: 4096,
248
+ reasoningOutput: false,
249
+ imageOutputs: false,
250
+ audioOutputs: false,
251
+ videoOutputs: false,
252
+ toolCalling: true,
253
+ structuredOutput: false
254
+ },
255
+ "grok-3-mini-latest": {
256
+ maxInputTokens: 131072,
257
+ imageInputs: false,
258
+ audioInputs: false,
259
+ pdfInputs: false,
260
+ videoInputs: false,
261
+ maxOutputTokens: 8192,
262
+ reasoningOutput: true,
263
+ imageOutputs: false,
264
+ audioOutputs: false,
265
+ videoOutputs: false,
266
+ toolCalling: true,
267
+ structuredOutput: false
268
+ },
269
+ "grok-3-mini-fast": {
270
+ maxInputTokens: 131072,
271
+ imageInputs: false,
272
+ audioInputs: false,
273
+ pdfInputs: false,
274
+ videoInputs: false,
275
+ maxOutputTokens: 8192,
276
+ reasoningOutput: true,
277
+ imageOutputs: false,
278
+ audioOutputs: false,
279
+ videoOutputs: false,
280
+ toolCalling: true,
281
+ structuredOutput: false
282
+ }
283
+ };
284
+ var profiles_default = PROFILES;
285
+
286
+ //#endregion
287
+ export { profiles_default as default };
288
+ //# sourceMappingURL=profiles.js.map