import { useState } from 'react'; export default function APIKeyModal({ isApiModalOpen, setIsApiModalOpen, apiKey, setApiKey, }: { isApiModalOpen: boolean; setIsApiModalOpen: React.Dispatch>; apiKey: string; setApiKey: React.Dispatch>; }) { const [formError, setFormError] = useState(false); const handleResetKey = () => { if (!apiKey) { setFormError(true); } else { setFormError(false); setIsApiModalOpen(false); } }; return (

OpenAI API Key

Before you can start using DocsGPT we need you to provide an API key for llm. Currently, we support only OpenAI but soon many more. You can find it here.

setApiKey(e.target.value)} />
{formError && (

Please enter a valid API key

)}
); }