Support image/file attachments (#80)

This commit is contained in:
Will Chen
2025-05-05 12:38:09 -07:00
committed by GitHub
parent 0108ff1a82
commit ac8ef73bee
10 changed files with 620 additions and 34 deletions

View File

@@ -52,12 +52,17 @@ export function useStreamChat({
prompt,
chatId,
redo,
attachments,
}: {
prompt: string;
chatId: number;
redo?: boolean;
attachments?: File[];
}) => {
if (!prompt.trim() || !chatId) {
if (
(!prompt.trim() && (!attachments || attachments.length === 0)) ||
!chatId
) {
return;
}
@@ -68,6 +73,7 @@ export function useStreamChat({
IpcClient.getInstance().streamMessage(prompt, {
chatId,
redo,
attachments,
onUpdate: (updatedMessages: Message[]) => {
if (!hasIncrementedStreamCount) {
setStreamCount((streamCount) => streamCount + 1);