From e78a5b0a050818454344020b1682c07c1051f932 Mon Sep 17 00:00:00 2001 From: Andrew Trokhymenko Date: Mon, 18 Nov 2024 19:55:28 -0500 Subject: [PATCH] image-upload --- app/components/chat/BaseChat.tsx | 121 ++++++++++++++++------ app/components/chat/Chat.client.tsx | 42 +++++++- app/components/chat/FilePreview.tsx | 40 +++++++ app/components/chat/SendButton.client.tsx | 5 +- app/components/chat/UserMessage.tsx | 27 ++++- app/components/sidebar/Menu.client.tsx | 2 +- app/components/workbench/EditorPanel.tsx | 9 +- app/components/workbench/FileTree.tsx | 2 +- app/lib/.server/llm/stream-text.ts | 41 ++++++-- app/routes/api.chat.ts | 17 ++- 10 files changed, 244 insertions(+), 62 deletions(-) create mode 100644 app/components/chat/FilePreview.tsx diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 629c5cb..e0cd928 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -17,6 +17,8 @@ import Cookies from 'js-cookie'; import styles from './BaseChat.module.scss'; import type { ProviderInfo } from '~/utils/types'; +import FilePreview from './FilePreview'; + const EXAMPLE_PROMPTS = [ { text: 'Build a todo app in React using Tailwind' }, { text: 'Build a simple blog using Astro' }, @@ -33,7 +35,7 @@ const ModelSelector = ({ model, setModel, provider, setProvider, modelList, prov