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
1 change: 1 addition & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export default function Home() {
errorMessage={errorMessage}
isLoading={isLoading}
isRateLimited={isRateLimited}
hasUserApiKey={!!languageModel.apiKey}
stop={stop}
input={chatInput}
handleInputChange={handleSaveInputChange}
Expand Down
8 changes: 5 additions & 3 deletions components/chat-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function ChatInput({
errorMessage,
isLoading,
isRateLimited,
hasUserApiKey,
stop,
input,
handleInputChange,
Expand All @@ -33,6 +34,7 @@ export function ChatInput({
errorMessage: string
isLoading: boolean
isRateLimited: boolean
hasUserApiKey: boolean
stop: () => void
input: string
handleInputChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void
Expand Down Expand Up @@ -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}
Expand All @@ -209,7 +211,7 @@ export function ChatInput({
<Tooltip delayDuration={0}>
<TooltipTrigger asChild>
<Button
disabled={!isMultiModal || isErrored}
disabled={!isMultiModal || (isErrored && !(isRateLimited && hasUserApiKey))}
type="button"
variant="outline"
size="icon"
Expand All @@ -233,7 +235,7 @@ export function ChatInput({
<Tooltip delayDuration={0}>
<TooltipTrigger asChild>
<Button
disabled={isErrored}
disabled={isErrored && !(isRateLimited && hasUserApiKey)}
variant="default"
size="icon"
type="submit"
Expand Down