Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions components/settings/components/model-selection-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 16 additions & 0 deletions lib/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down