forked from React-Group/interstellar_ai
Backend and frontend tweaks #16
1 changed files with 9 additions and 7 deletions
|
@ -113,13 +113,15 @@ const InputOutputBackend: React.FC = () => {
|
|||
setMessages(previous => [...previous,{role,content}])
|
||||
}
|
||||
const handleSendClick = (inputValue: string) => {
|
||||
if (sendable) {
|
||||
sendable=false
|
||||
if (postWorkerRef.current) {
|
||||
addMessage("user", inputValue)
|
||||
console.log("input:",inputValue);
|
||||
postWorkerRef.current.postMessage({messages:[...messages, { role: "user", content: inputValue }], ai_model:"phi3.5", access_token:accessToken})
|
||||
startGetWorker()
|
||||
if (inputValue != "") {
|
||||
if (sendable) {
|
||||
sendable=false
|
||||
if (postWorkerRef.current) {
|
||||
addMessage("user", inputValue)
|
||||
console.log("input:",inputValue);
|
||||
postWorkerRef.current.postMessage({messages:[...messages, { role: "user", content: inputValue }], ai_model:"phi3.5", access_token:accessToken})
|
||||
startGetWorker()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue