Skip to content

Commit

Permalink
Refactor Home component to reorganize language model handling and int…
Browse files Browse the repository at this point in the history
…egrate file change functionality in ChatInput
  • Loading branch information
eraykeskinmac committed Dec 7, 2024
1 parent 195b641 commit c7605fa
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ export default function Home() {
supabase ? supabase.auth.signOut() : console.warn("supabase not loaded");
}

function handleLanguageModelChange(e: LLMModelConfig) {
setLanguageModel({ ...languageModel, ...e });
}

const currentModal = modelsList.models.find(
(model) => model.id === languageModel.model
);
Expand Down Expand Up @@ -191,6 +187,14 @@ export default function Home() {
});
}

function handleFileChange(file: File[]) {
setFiles(file);
}

function handleLanguageModelChange(e: LLMModelConfig) {
setLanguageModel({ ...languageModel, ...e });
}

return (
<main className="flex min-h-screen max-h-screen">
{supabase && (
Expand All @@ -213,18 +217,18 @@ export default function Home() {
onUndo={handleUndo}
canUndo={messages.length > 1 && !isLoading}
/>
<Chat />
<Chat messages={messages} isLoading={isLoading} setCurrentPreview={setCurrentPreview} />
<ChatInput
isLoading={isLoading}
input={chatInput}
handleInputChange={handleSaveInputChange}
handleSubmit={handleSubmitAuth}
handleFileChange={() => {}}
handleFileChange={handleFileChange}
files={files}
error={error}
retry={retry}
isMultiModal={false}
stop={() => {}}
stop={stop}
>
<ChatPicker
models={modelsList.models}
Expand Down

0 comments on commit c7605fa

Please sign in to comment.