Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/components/Chat/ChatBotComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,11 @@ const ChatBotComponent: React.FunctionComponent<ChatbotComponentProps> = ({
};

stopped.current = false;
await modelFetcher(model, input, setCurrentMessage, setController);
try {
await modelFetcher(model, input, setCurrentMessage, setController);
} catch (e) {
console.error(`Model fetch failed: `, e);
}

setIsLoading(false);
setFetching(false);
Expand Down
4 changes: 2 additions & 2 deletions src/components/Chat/ChatBotContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ const ChatBotContainer: React.FC = () => {

const handleStopButton = () => {
if (mainChatController) {
mainChatController.abort();
mainChatController.abort('user stopped');
}
if (altChatController) {
altChatController.abort();
altChatController.abort('user stopped');
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/Chat/modelService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const defaultModelFetcher = async (
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ input, systemRole }),
body: JSON.stringify({ question: input, systemRole }),
signal: newController.signal
}
);
Expand Down