/* Copyright 2026 Marimo. All rights reserved. */ import React from "react"; import { AiModelId, type QualifiedModelId } from "@/core/ai/ids/ids"; import { Banner } from "@/plugins/impl/common/error-banner"; interface IncorrectModelIdProps { value: string | null | undefined; includeSuggestion?: boolean; } export const IncorrectModelId: React.FC = ({ value, includeSuggestion = true, }) => { if (!value) { return null; } // Only incorrect if missing a slash if (value.includes("/")) { return null; } // Try to "correct" by guessing provider const parsed = AiModelId.parse(value as QualifiedModelId); const suggestion = parsed.id; return ( Model id should be in the form{" "} provider/model. {value} is missing a provider.
{includeSuggestion && suggestion && ( Did you mean {suggestion}? )}
); };