@tanstack/ai-grok 0.6.3 → 0.6.5
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.
- package/dist/esm/model-meta.d.ts +39 -1
- package/dist/esm/model-meta.js +9 -1
- package/dist/esm/model-meta.js.map +1 -1
- package/package.json +2 -2
- package/src/model-meta.ts +43 -0
package/dist/esm/model-meta.d.ts
CHANGED
|
@@ -163,7 +163,43 @@ declare const GROK_2_VISION: {
|
|
|
163
163
|
* Grok Chat Models
|
|
164
164
|
* Based on xAI's available models as of 2025
|
|
165
165
|
*/
|
|
166
|
-
|
|
166
|
+
declare const GROK_4_20: {
|
|
167
|
+
readonly name: "grok-4.20";
|
|
168
|
+
readonly context_window: 2000000;
|
|
169
|
+
readonly supports: {
|
|
170
|
+
readonly input: ["text", "image", "document"];
|
|
171
|
+
readonly output: ["text"];
|
|
172
|
+
readonly capabilities: ["reasoning", "structured_outputs", "tool_calling"];
|
|
173
|
+
};
|
|
174
|
+
readonly pricing: {
|
|
175
|
+
readonly input: {
|
|
176
|
+
readonly normal: 2;
|
|
177
|
+
readonly cached: 0.2;
|
|
178
|
+
};
|
|
179
|
+
readonly output: {
|
|
180
|
+
readonly normal: 6;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
declare const GROK_4_20_MULTI_AGENT: {
|
|
185
|
+
readonly name: "grok-4.20-multi-agent";
|
|
186
|
+
readonly context_window: 2000000;
|
|
187
|
+
readonly supports: {
|
|
188
|
+
readonly input: ["text", "image", "document"];
|
|
189
|
+
readonly output: ["text"];
|
|
190
|
+
readonly capabilities: ["reasoning", "structured_outputs", "tool_calling"];
|
|
191
|
+
};
|
|
192
|
+
readonly pricing: {
|
|
193
|
+
readonly input: {
|
|
194
|
+
readonly normal: 2;
|
|
195
|
+
readonly cached: 0.2;
|
|
196
|
+
};
|
|
197
|
+
readonly output: {
|
|
198
|
+
readonly normal: 6;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
export declare const GROK_CHAT_MODELS: readonly ["grok-4-1-fast-reasoning", "grok-4-1-fast-non-reasoning", "grok-code-fast-1", "grok-4-fast-reasoning", "grok-4-fast-non-reasoning", "grok-4", "grok-3", "grok-3-mini", "grok-2-vision-1212", "grok-4.20", "grok-4.20-multi-agent"];
|
|
167
203
|
/**
|
|
168
204
|
* Grok Image Generation Models
|
|
169
205
|
*/
|
|
@@ -184,6 +220,8 @@ export type GrokModelInputModalitiesByName = {
|
|
|
184
220
|
[GROK_3.name]: typeof GROK_3.supports.input;
|
|
185
221
|
[GROK_3_MINI.name]: typeof GROK_3_MINI.supports.input;
|
|
186
222
|
[GROK_2_VISION.name]: typeof GROK_2_VISION.supports.input;
|
|
223
|
+
[GROK_4_20.name]: typeof GROK_4_20.supports.input;
|
|
224
|
+
[GROK_4_20_MULTI_AGENT.name]: typeof GROK_4_20_MULTI_AGENT.supports.input;
|
|
187
225
|
};
|
|
188
226
|
/**
|
|
189
227
|
* Type-only map from Grok chat model name to its provider options type.
|
package/dist/esm/model-meta.js
CHANGED
|
@@ -28,6 +28,12 @@ const GROK_2_VISION = {
|
|
|
28
28
|
const GROK_2_IMAGE = {
|
|
29
29
|
name: "grok-2-image-1212"
|
|
30
30
|
};
|
|
31
|
+
const GROK_4_20 = {
|
|
32
|
+
name: "grok-4.20"
|
|
33
|
+
};
|
|
34
|
+
const GROK_4_20_MULTI_AGENT = {
|
|
35
|
+
name: "grok-4.20-multi-agent"
|
|
36
|
+
};
|
|
31
37
|
const GROK_CHAT_MODELS = [
|
|
32
38
|
GROK_4_1_FAST_REASONING.name,
|
|
33
39
|
GROK_4_1_FAST_NON_REASONING.name,
|
|
@@ -37,7 +43,9 @@ const GROK_CHAT_MODELS = [
|
|
|
37
43
|
GROK_4.name,
|
|
38
44
|
GROK_3.name,
|
|
39
45
|
GROK_3_MINI.name,
|
|
40
|
-
GROK_2_VISION.name
|
|
46
|
+
GROK_2_VISION.name,
|
|
47
|
+
GROK_4_20.name,
|
|
48
|
+
GROK_4_20_MULTI_AGENT.name
|
|
41
49
|
];
|
|
42
50
|
const GROK_IMAGE_MODELS = [GROK_2_IMAGE.name];
|
|
43
51
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-meta.js","sources":["../../src/model-meta.ts"],"sourcesContent":["/**\n * Model metadata interface for documentation and type inference\n */\ninterface ModelMeta {\n name: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n output: Array<'text' | 'image' | 'audio' | 'video'>\n capabilities?: Array<'reasoning' | 'tool_calling' | 'structured_outputs'>\n }\n max_input_tokens?: number\n max_output_tokens?: number\n context_window?: number\n knowledge_cutoff?: string\n pricing?: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n}\n\nconst GROK_4_1_FAST_REASONING = {\n name: 'grok-4-1-fast-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4_1_FAST_NON_REASONING = {\n name: 'grok-4-1-fast-non-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_CODE_FAST_1 = {\n name: 'grok-code-fast-1',\n context_window: 256_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.02,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4_FAST_REASONING = {\n name: 'grok-4-fast-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4_FAST_NON_REASONING = {\n name: 'grok-4-fast-non-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4 = {\n name: 'grok-4',\n context_window: 256_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 3,\n cached: 0.75,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_3_MINI = {\n name: 'grok-3-mini',\n context_window: 131_072,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.3,\n cached: 0.075,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_3 = {\n name: 'grok-3',\n context_window: 131_072,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 3,\n cached: 0.75,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_2_VISION = {\n name: 'grok-2-vision-1212',\n context_window: 32_768,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 2,\n },\n output: {\n normal: 10,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_2_IMAGE = {\n name: 'grok-2-image-1212',\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0.07,\n },\n output: {\n normal: 0.07,\n },\n },\n} as const satisfies ModelMeta\n\n/**\n * Grok Chat Models\n * Based on xAI's available models as of 2025\n */\nexport const GROK_CHAT_MODELS = [\n GROK_4_1_FAST_REASONING.name,\n GROK_4_1_FAST_NON_REASONING.name,\n GROK_CODE_FAST_1.name,\n GROK_4_FAST_REASONING.name,\n GROK_4_FAST_NON_REASONING.name,\n GROK_4.name,\n GROK_3.name,\n GROK_3_MINI.name,\n GROK_2_VISION.name,\n] as const\n\n/**\n * Grok Image Generation Models\n */\nexport const GROK_IMAGE_MODELS = [GROK_2_IMAGE.name] as const\n\nexport type GrokChatModel = (typeof GROK_CHAT_MODELS)[number]\nexport type GrokImageModel = (typeof GROK_IMAGE_MODELS)[number]\n\n/**\n * Type-only map from Grok chat model name to its supported input modalities.\n * Used for type inference when constructing multimodal messages.\n */\nexport type GrokModelInputModalitiesByName = {\n [GROK_4_1_FAST_REASONING.name]: typeof GROK_4_1_FAST_REASONING.supports.input\n [GROK_4_1_FAST_NON_REASONING.name]: typeof GROK_4_1_FAST_NON_REASONING.supports.input\n [GROK_CODE_FAST_1.name]: typeof GROK_CODE_FAST_1.supports.input\n [GROK_4_FAST_REASONING.name]: typeof GROK_4_FAST_REASONING.supports.input\n [GROK_4_FAST_NON_REASONING.name]: typeof GROK_4_FAST_NON_REASONING.supports.input\n [GROK_4.name]: typeof GROK_4.supports.input\n [GROK_3.name]: typeof GROK_3.supports.input\n [GROK_3_MINI.name]: typeof GROK_3_MINI.supports.input\n [GROK_2_VISION.name]: typeof GROK_2_VISION.supports.input\n}\n\n/**\n * Type-only map from Grok chat model name to its provider options type.\n * Since Grok uses OpenAI-compatible API, we reuse OpenAI provider options.\n */\nexport type GrokChatModelProviderOptionsByName = {\n [K in (typeof GROK_CHAT_MODELS)[number]]: GrokProviderOptions\n}\n\n/**\n * Grok-specific provider options\n * Based on OpenAI-compatible API options\n */\nexport interface GrokProviderOptions {\n /** Temperature for response generation (0-2) */\n temperature?: number\n /** Maximum tokens in the response */\n max_tokens?: number\n /** Top-p sampling parameter */\n top_p?: number\n /** Frequency penalty (-2.0 to 2.0) */\n frequency_penalty?: number\n /** Presence penalty (-2.0 to 2.0) */\n presence_penalty?: number\n /** Stop sequences */\n stop?: string | Array<string>\n /** A unique identifier representing your end-user */\n user?: string\n}\n\n// ===========================\n// Type Resolution Helpers\n// ===========================\n\n/**\n * Resolve provider options for a specific model.\n * If the model has explicit options in the map, use those; otherwise use base options.\n */\nexport type ResolveProviderOptions<TModel extends string> =\n TModel extends keyof GrokChatModelProviderOptionsByName\n ? GrokChatModelProviderOptionsByName[TModel]\n : GrokProviderOptions\n\n/**\n * Resolve input modalities for a specific model.\n * If the model has explicit modalities in the map, use those; otherwise use text only.\n */\nexport type ResolveInputModalities<TModel extends string> =\n TModel extends keyof GrokModelInputModalitiesByName\n ? GrokModelInputModalitiesByName[TModel]\n : readonly ['text']\n"],"names":[],"mappings":"AAyBA,MAAM,0BAA0B;AAAA,EAC9B,MAAM;AAgBR;AAEA,MAAM,8BAA8B;AAAA,EAClC,MAAM;AAgBR;AAEA,MAAM,mBAAmB;AAAA,EACvB,MAAM;AAgBR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAgBR;AAEA,MAAM,4BAA4B;AAAA,EAChC,MAAM;AAgBR;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAgBR;AAEA,MAAM,cAAc;AAAA,EAClB,MAAM;AAgBR;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAgBR;AAEA,MAAM,gBAAgB;AAAA,EACpB,MAAM;AAeR;AAEA,MAAM,eAAe;AAAA,EACnB,MAAM;AAaR;
|
|
1
|
+
{"version":3,"file":"model-meta.js","sources":["../../src/model-meta.ts"],"sourcesContent":["/**\n * Model metadata interface for documentation and type inference\n */\ninterface ModelMeta {\n name: string\n supports: {\n input: Array<'text' | 'image' | 'audio' | 'video' | 'document'>\n output: Array<'text' | 'image' | 'audio' | 'video'>\n capabilities?: Array<'reasoning' | 'tool_calling' | 'structured_outputs'>\n }\n max_input_tokens?: number\n max_output_tokens?: number\n context_window?: number\n knowledge_cutoff?: string\n pricing?: {\n input: {\n normal: number\n cached?: number\n }\n output: {\n normal: number\n }\n }\n}\n\nconst GROK_4_1_FAST_REASONING = {\n name: 'grok-4-1-fast-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4_1_FAST_NON_REASONING = {\n name: 'grok-4-1-fast-non-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_CODE_FAST_1 = {\n name: 'grok-code-fast-1',\n context_window: 256_000,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.02,\n },\n output: {\n normal: 1.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4_FAST_REASONING = {\n name: 'grok-4-fast-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4_FAST_NON_REASONING = {\n name: 'grok-4-fast-non-reasoning',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.2,\n cached: 0.05,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4 = {\n name: 'grok-4',\n context_window: 256_000,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 3,\n cached: 0.75,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_3_MINI = {\n name: 'grok-3-mini',\n context_window: 131_072,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 0.3,\n cached: 0.075,\n },\n output: {\n normal: 0.5,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_3 = {\n name: 'grok-3',\n context_window: 131_072,\n supports: {\n input: ['text'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 3,\n cached: 0.75,\n },\n output: {\n normal: 15,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_2_VISION = {\n name: 'grok-2-vision-1212',\n context_window: 32_768,\n supports: {\n input: ['text', 'image'],\n output: ['text'],\n capabilities: ['structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 2,\n },\n output: {\n normal: 10,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_2_IMAGE = {\n name: 'grok-2-image-1212',\n supports: {\n input: ['text'],\n output: ['image'],\n },\n pricing: {\n input: {\n normal: 0.07,\n },\n output: {\n normal: 0.07,\n },\n },\n} as const satisfies ModelMeta\n\n/**\n * Grok Chat Models\n * Based on xAI's available models as of 2025\n */\nconst GROK_4_20 = {\n name: 'grok-4.20',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 2,\n cached: 0.2,\n },\n output: {\n normal: 6,\n },\n },\n} as const satisfies ModelMeta\n\nconst GROK_4_20_MULTI_AGENT = {\n name: 'grok-4.20-multi-agent',\n context_window: 2_000_000,\n supports: {\n input: ['text', 'image', 'document'],\n output: ['text'],\n capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],\n },\n pricing: {\n input: {\n normal: 2,\n cached: 0.2,\n },\n output: {\n normal: 6,\n },\n },\n} as const satisfies ModelMeta\n\nexport const GROK_CHAT_MODELS = [\n GROK_4_1_FAST_REASONING.name,\n GROK_4_1_FAST_NON_REASONING.name,\n GROK_CODE_FAST_1.name,\n GROK_4_FAST_REASONING.name,\n GROK_4_FAST_NON_REASONING.name,\n GROK_4.name,\n GROK_3.name,\n GROK_3_MINI.name,\n GROK_2_VISION.name,\n\n GROK_4_20.name,\n GROK_4_20_MULTI_AGENT.name,\n] as const\n\n/**\n * Grok Image Generation Models\n */\nexport const GROK_IMAGE_MODELS = [GROK_2_IMAGE.name] as const\n\nexport type GrokChatModel = (typeof GROK_CHAT_MODELS)[number]\nexport type GrokImageModel = (typeof GROK_IMAGE_MODELS)[number]\n\n/**\n * Type-only map from Grok chat model name to its supported input modalities.\n * Used for type inference when constructing multimodal messages.\n */\nexport type GrokModelInputModalitiesByName = {\n [GROK_4_1_FAST_REASONING.name]: typeof GROK_4_1_FAST_REASONING.supports.input\n [GROK_4_1_FAST_NON_REASONING.name]: typeof GROK_4_1_FAST_NON_REASONING.supports.input\n [GROK_CODE_FAST_1.name]: typeof GROK_CODE_FAST_1.supports.input\n [GROK_4_FAST_REASONING.name]: typeof GROK_4_FAST_REASONING.supports.input\n [GROK_4_FAST_NON_REASONING.name]: typeof GROK_4_FAST_NON_REASONING.supports.input\n [GROK_4.name]: typeof GROK_4.supports.input\n [GROK_3.name]: typeof GROK_3.supports.input\n [GROK_3_MINI.name]: typeof GROK_3_MINI.supports.input\n [GROK_2_VISION.name]: typeof GROK_2_VISION.supports.input\n [GROK_4_20.name]: typeof GROK_4_20.supports.input\n [GROK_4_20_MULTI_AGENT.name]: typeof GROK_4_20_MULTI_AGENT.supports.input\n}\n\n/**\n * Type-only map from Grok chat model name to its provider options type.\n * Since Grok uses OpenAI-compatible API, we reuse OpenAI provider options.\n */\nexport type GrokChatModelProviderOptionsByName = {\n [K in (typeof GROK_CHAT_MODELS)[number]]: GrokProviderOptions\n}\n\n/**\n * Grok-specific provider options\n * Based on OpenAI-compatible API options\n */\nexport interface GrokProviderOptions {\n /** Temperature for response generation (0-2) */\n temperature?: number\n /** Maximum tokens in the response */\n max_tokens?: number\n /** Top-p sampling parameter */\n top_p?: number\n /** Frequency penalty (-2.0 to 2.0) */\n frequency_penalty?: number\n /** Presence penalty (-2.0 to 2.0) */\n presence_penalty?: number\n /** Stop sequences */\n stop?: string | Array<string>\n /** A unique identifier representing your end-user */\n user?: string\n}\n\n// ===========================\n// Type Resolution Helpers\n// ===========================\n\n/**\n * Resolve provider options for a specific model.\n * If the model has explicit options in the map, use those; otherwise use base options.\n */\nexport type ResolveProviderOptions<TModel extends string> =\n TModel extends keyof GrokChatModelProviderOptionsByName\n ? GrokChatModelProviderOptionsByName[TModel]\n : GrokProviderOptions\n\n/**\n * Resolve input modalities for a specific model.\n * If the model has explicit modalities in the map, use those; otherwise use text only.\n */\nexport type ResolveInputModalities<TModel extends string> =\n TModel extends keyof GrokModelInputModalitiesByName\n ? GrokModelInputModalitiesByName[TModel]\n : readonly ['text']\n"],"names":[],"mappings":"AAyBA,MAAM,0BAA0B;AAAA,EAC9B,MAAM;AAgBR;AAEA,MAAM,8BAA8B;AAAA,EAClC,MAAM;AAgBR;AAEA,MAAM,mBAAmB;AAAA,EACvB,MAAM;AAgBR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAgBR;AAEA,MAAM,4BAA4B;AAAA,EAChC,MAAM;AAgBR;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAgBR;AAEA,MAAM,cAAc;AAAA,EAClB,MAAM;AAgBR;AAEA,MAAM,SAAS;AAAA,EACb,MAAM;AAgBR;AAEA,MAAM,gBAAgB;AAAA,EACpB,MAAM;AAeR;AAEA,MAAM,eAAe;AAAA,EACnB,MAAM;AAaR;AAMA,MAAM,YAAY;AAAA,EAChB,MAAM;AAgBR;AAEA,MAAM,wBAAwB;AAAA,EAC5B,MAAM;AAgBR;AAEO,MAAM,mBAAmB;AAAA,EAC9B,wBAAwB;AAAA,EACxB,4BAA4B;AAAA,EAC5B,iBAAiB;AAAA,EACjB,sBAAsB;AAAA,EACtB,0BAA0B;AAAA,EAC1B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,cAAc;AAAA,EAEd,UAAU;AAAA,EACV,sBAAsB;AACxB;AAKO,MAAM,oBAAoB,CAAC,aAAa,IAAI;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/ai-grok",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Grok (xAI) adapter for TanStack AI",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"zod": "^4.0.0",
|
|
41
|
-
"@tanstack/ai": "^0.
|
|
41
|
+
"@tanstack/ai": "^0.10.1"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "vite build",
|
package/src/model-meta.ts
CHANGED
|
@@ -213,6 +213,44 @@ const GROK_2_IMAGE = {
|
|
|
213
213
|
* Grok Chat Models
|
|
214
214
|
* Based on xAI's available models as of 2025
|
|
215
215
|
*/
|
|
216
|
+
const GROK_4_20 = {
|
|
217
|
+
name: 'grok-4.20',
|
|
218
|
+
context_window: 2_000_000,
|
|
219
|
+
supports: {
|
|
220
|
+
input: ['text', 'image', 'document'],
|
|
221
|
+
output: ['text'],
|
|
222
|
+
capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],
|
|
223
|
+
},
|
|
224
|
+
pricing: {
|
|
225
|
+
input: {
|
|
226
|
+
normal: 2,
|
|
227
|
+
cached: 0.2,
|
|
228
|
+
},
|
|
229
|
+
output: {
|
|
230
|
+
normal: 6,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
} as const satisfies ModelMeta
|
|
234
|
+
|
|
235
|
+
const GROK_4_20_MULTI_AGENT = {
|
|
236
|
+
name: 'grok-4.20-multi-agent',
|
|
237
|
+
context_window: 2_000_000,
|
|
238
|
+
supports: {
|
|
239
|
+
input: ['text', 'image', 'document'],
|
|
240
|
+
output: ['text'],
|
|
241
|
+
capabilities: ['reasoning', 'structured_outputs', 'tool_calling'],
|
|
242
|
+
},
|
|
243
|
+
pricing: {
|
|
244
|
+
input: {
|
|
245
|
+
normal: 2,
|
|
246
|
+
cached: 0.2,
|
|
247
|
+
},
|
|
248
|
+
output: {
|
|
249
|
+
normal: 6,
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
} as const satisfies ModelMeta
|
|
253
|
+
|
|
216
254
|
export const GROK_CHAT_MODELS = [
|
|
217
255
|
GROK_4_1_FAST_REASONING.name,
|
|
218
256
|
GROK_4_1_FAST_NON_REASONING.name,
|
|
@@ -223,6 +261,9 @@ export const GROK_CHAT_MODELS = [
|
|
|
223
261
|
GROK_3.name,
|
|
224
262
|
GROK_3_MINI.name,
|
|
225
263
|
GROK_2_VISION.name,
|
|
264
|
+
|
|
265
|
+
GROK_4_20.name,
|
|
266
|
+
GROK_4_20_MULTI_AGENT.name,
|
|
226
267
|
] as const
|
|
227
268
|
|
|
228
269
|
/**
|
|
@@ -247,6 +288,8 @@ export type GrokModelInputModalitiesByName = {
|
|
|
247
288
|
[GROK_3.name]: typeof GROK_3.supports.input
|
|
248
289
|
[GROK_3_MINI.name]: typeof GROK_3_MINI.supports.input
|
|
249
290
|
[GROK_2_VISION.name]: typeof GROK_2_VISION.supports.input
|
|
291
|
+
[GROK_4_20.name]: typeof GROK_4_20.supports.input
|
|
292
|
+
[GROK_4_20_MULTI_AGENT.name]: typeof GROK_4_20_MULTI_AGENT.supports.input
|
|
250
293
|
}
|
|
251
294
|
|
|
252
295
|
/**
|