diff --git a/app/page.tsx b/app/page.tsx index 05817e6d..3d611a8b 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -319,6 +319,7 @@ export default function Home() { errorMessage={errorMessage} isLoading={isLoading} isRateLimited={isRateLimited} + hasUserApiKey={!!languageModel.apiKey} stop={stop} input={chatInput} handleInputChange={handleSaveInputChange} diff --git a/components/chat-input.tsx b/components/chat-input.tsx index 4c952262..77d04153 100644 --- a/components/chat-input.tsx +++ b/components/chat-input.tsx @@ -19,6 +19,7 @@ export function ChatInput({ errorMessage, isLoading, isRateLimited, + hasUserApiKey, stop, input, handleInputChange, @@ -33,6 +34,7 @@ export function ChatInput({ errorMessage: string isLoading: boolean isRateLimited: boolean + hasUserApiKey: boolean stop: () => void input: string handleInputChange: (e: React.ChangeEvent) => void @@ -189,7 +191,7 @@ export function ChatInput({ className="text-normal px-3 resize-none ring-0 bg-inherit w-full m-0 outline-none" required={true} placeholder="Describe your app..." - disabled={isErrored} + disabled={isErrored && !(isRateLimited && hasUserApiKey)} value={input} onChange={handleInputChange} onPaste={isMultiModal ? handlePaste : undefined} @@ -209,7 +211,7 @@ export function ChatInput({