diff --git a/components/settings/components/model-selection-form.tsx b/components/settings/components/model-selection-form.tsx index bc6164ba..edfbddc6 100644 --- a/components/settings/components/model-selection-form.tsx +++ b/components/settings/components/model-selection-form.tsx @@ -35,13 +35,21 @@ const models = [ badgeVariant: "default" as const, }, { - id: "Grok 4.2", - name: "Grok 4.2", - description: "The latest from xAI, pushing the boundaries of reasoning and problem-solving.", + id: "Grok 4.3", + name: "Grok 4.3", + description: "The latest from xAI, featuring enhanced reasoning and real-time knowledge.", icon: Rocket, badge: "New", badgeVariant: "secondary" as const, }, + { + id: "Grok 4.2", + name: "Grok 4.2", + description: "Reliable reasoning model from xAI, pushing the boundaries of problem-solving.", + icon: Rocket, + badge: "Stable", + badgeVariant: "outline" as const, + }, { id: "Gemini 3.1 Pro", name: "Gemini 3.1 Pro", diff --git a/lib/utils/index.ts b/lib/utils/index.ts index 15565281..ac48c8f1 100644 --- a/lib/utils/index.ts +++ b/lib/utils/index.ts @@ -34,6 +34,22 @@ export async function getModel(requireVision: boolean = false) { if (selectedModel) { switch (selectedModel) { + case 'Grok 4.3': + if (xaiApiKey) { + const xai = createXai({ + apiKey: xaiApiKey, + baseURL: 'https://api.x.ai/v1', + }); + try { + return xai('grok-latest'); + } catch (error) { + console.error('Selected model "Grok 4.3" is configured but failed to initialize.', error); + throw new Error('Failed to initialize selected model.'); + } + } else { + console.error('User selected "Grok 4.3" but XAI_API_KEY is not set.'); + throw new Error('Selected model is not configured.'); + } case 'Grok 4.2': if (xaiApiKey) { const xai = createXai({