ui: Allow rephrasing last prompt

This commit is contained in:
Deepak Seth 2023-12-17 16:33:25 -08:00
parent 622975b742
commit aa1967f48a

View file

@ -666,6 +666,16 @@
}
}
const rephraseChat = (e) => {
e.preventDefault();
const _transcript = session.value.transcript;
_transcript.pop();
const _chatMsg = _transcript.pop();
transcriptUpdate(_transcript);
if (typeof (_chatMsg[1]) === 'string')
message.value = _chatMsg[1];
}
return html`
<form onsubmit=${submit}>
<div>
@ -688,6 +698,7 @@
<button onclick=${uploadImage}>Upload Image</button>
<button onclick=${stop} disabled=${!generating.value}>Stop</button>
<button onclick=${reset}>Reset</button>
<button onclick=${rephraseChat}>Rephrase last message</button>
</div>
</form>
`