diff --git a/src/frontend/src/modals/formModal/index.tsx b/src/frontend/src/modals/formModal/index.tsx index 01d6a0954..e80e1e7ce 100644 --- a/src/frontend/src/modals/formModal/index.tsx +++ b/src/frontend/src/modals/formModal/index.tsx @@ -124,12 +124,13 @@ export default function FormModal({ function updateLastMessage({ str, thought, + prompt, end = false, files, }: { str?: string; thought?: string; - // end param default is false + prompt?: string; end?: boolean; files?: Array; }) { @@ -149,6 +150,9 @@ export default function FormModal({ if (files) { newChat[newChat.length - 1].files = files; } + if (prompt) { + newChat[newChat.length - 1].template = prompt; + } return newChat; }); } @@ -244,7 +248,10 @@ export default function FormModal({ isStream = false; } if (data.type === "stream" && isStream) { - updateLastMessage({ str: data.message }); + if (data.prompt) { + } else { + updateLastMessage({ str: data.message }); + } } } diff --git a/src/frontend/src/types/chat/index.ts b/src/frontend/src/types/chat/index.ts index 2e7a65fdb..71a081be7 100644 --- a/src/frontend/src/types/chat/index.ts +++ b/src/frontend/src/types/chat/index.ts @@ -8,5 +8,6 @@ export type ChatMessageType = { isSend: boolean; thought?: string; files?: Array<{ data: string; type: string; data_type: string }>; + prompt?: string; chatKey: string; };