Skip to content

Commit

Permalink
Allow for longer timeout period
Browse files Browse the repository at this point in the history
  • Loading branch information
Hayden2018 committed Dec 17, 2023
1 parent a64341f commit d584529
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions electron-src/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ async function sendResponseStream(window, {

let lastChunkTime = new Date().getTime();
let checkTimeout = setInterval(() => {
if (new Date().getTime() - lastChunkTime > 9000) {
if (new Date().getTime() - lastChunkTime > 30000) {
clearInterval(checkTimeout);
window.webContents.send(requestId, {
finish_reason: 'timeout',
});
}
}, 900);
}, 1000);

let residue = '';
response.data.on('data', (chunk) => {
Expand Down
2 changes: 1 addition & 1 deletion src/sections/ChatInterface/ChatInterface.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const useMessageActions = (currentChat: Chat | null) => {
regenerate,
onKeyDown,
stopGenerate,
value: draft,
draft,
};
}

Expand Down
4 changes: 2 additions & 2 deletions src/sections/ChatInterface/ChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function ChatInterface({ setMenuOpen }: { setMenuOpen: React.Dispatch<React.SetS
const dispatch = useDispatch();
const screenWidth = useScreenWidth();
const currentChat = useCurrentChatSelector();
const { onChange, sendMessage, regenerate, onKeyDown, stopGenerate, value } = useMessageActions(currentChat);
const { onChange, sendMessage, regenerate, onKeyDown, stopGenerate, draft } = useMessageActions(currentChat);
const { editing, toggleEdit } = useChatEditActions(currentChat);

const streamingMsgId = currentChat?.streamingMsgId;
Expand Down Expand Up @@ -324,7 +324,7 @@ function ChatInterface({ setMenuOpen }: { setMenuOpen: React.Dispatch<React.SetS
multiline
label='Your Message'
rows={screenWidth < 800 ? 2 : 3}
value={value}
value={draft}
onChange={onChange}
onKeyDown={onKeyDown}
/>
Expand Down

0 comments on commit d584529

Please sign in to comment.