forked from React-Group/interstellar_ai
no empty msg
This commit is contained in:
parent
8821836f3d
commit
d037439b4c
1 changed files with 9 additions and 7 deletions
|
@ -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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue