fix(formModal/index.tsx): update updateLastMessage function to include prompt value when data.type is "end"
fix(formModal/index.tsx): update template.current value when data.type is "prompt" and data.prompt is provided fix(formModal/index.tsx): remove unnecessary updateLastMessage call when data.type is "stream" and isStream is true
This commit is contained in:
parent
57b9ab6843
commit
03d12b53cd
1 changed files with 9 additions and 10 deletions
|
|
@ -261,7 +261,11 @@ export default function FormModal({
|
|||
}
|
||||
if (data.type === "end") {
|
||||
if (data.message) {
|
||||
updateLastMessage({ str: data.message, end: true });
|
||||
updateLastMessage({
|
||||
str: data.message,
|
||||
end: true,
|
||||
prompt: template.current,
|
||||
});
|
||||
}
|
||||
if (data.intermediate_steps) {
|
||||
updateLastMessage({
|
||||
|
|
@ -276,19 +280,14 @@ export default function FormModal({
|
|||
files: data.files,
|
||||
});
|
||||
}
|
||||
if (data.type === "prompt" && data.prompt) {
|
||||
template.current = data.prompt;
|
||||
}
|
||||
|
||||
setLockChat(false);
|
||||
isStream = false;
|
||||
}
|
||||
if (data.type == "prompt" && data.prompt) {
|
||||
template.current = data.prompt;
|
||||
}
|
||||
if (data.type === "stream" && isStream) {
|
||||
if (data.prompt) {
|
||||
updateLastMessage({ prompt: data.prompt });
|
||||
} else {
|
||||
updateLastMessage({ str: data.message });
|
||||
}
|
||||
updateLastMessage({ str: data.message });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue