no empty msg

This commit is contained in:
YasinOnm08 2024-09-24 10:22:50 +02:00
parent 8821836f3d
commit d037439b4c

View file

@ -113,13 +113,15 @@ const InputOutputBackend: React.FC = () => {
setMessages(previous => [...previous,{role,content}]) setMessages(previous => [...previous,{role,content}])
} }
const handleSendClick = (inputValue: string) => { const handleSendClick = (inputValue: string) => {
if (sendable) { if (inputValue != "") {
sendable=false if (sendable) {
if (postWorkerRef.current) { sendable=false
addMessage("user", inputValue) if (postWorkerRef.current) {
console.log("input:",inputValue); addMessage("user", inputValue)
postWorkerRef.current.postMessage({messages:[...messages, { role: "user", content: inputValue }], ai_model:"phi3.5", access_token:accessToken}) console.log("input:",inputValue);
startGetWorker() postWorkerRef.current.postMessage({messages:[...messages, { role: "user", content: inputValue }], ai_model:"phi3.5", access_token:accessToken})
startGetWorker()
}
} }
} }
} }