stream aborter cleanup
This commit is contained in:
parent
022b7a7d7d
commit
32ee22bf70
3 changed files with 2 additions and 9 deletions
|
|
@ -21,7 +21,6 @@ import TextDialog from "./dialogs";
|
|||
import Footer from "./Footer";
|
||||
import { isNewUserOnboarding, useOnboardingCard } from "./OnboardingCard";
|
||||
import PostHogPageView from "./PosthogPageView";
|
||||
import { setInactive } from "../redux/slices/stateSlice";
|
||||
|
||||
const LayoutTopDiv = styled(CustomScrollbarDiv)`
|
||||
height: 100%;
|
||||
|
|
|
|||
|
|
@ -69,15 +69,13 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
|||
}, [active]);
|
||||
|
||||
async function _streamNormalInput(messages: ChatMessage[]) {
|
||||
const cancelToken = streamAborter.signal;
|
||||
|
||||
try {
|
||||
if (!defaultModel) {
|
||||
throw new Error("Default model not defined");
|
||||
}
|
||||
const gen = ideMessenger.llmStreamChat(
|
||||
defaultModel.title,
|
||||
cancelToken,
|
||||
streamAborter.signal,
|
||||
messages,
|
||||
);
|
||||
let next = await gen.next();
|
||||
|
|
|
|||
|
|
@ -7,11 +7,7 @@ import { useSelector } from "react-redux";
|
|||
import { IdeMessengerContext } from "../context/IdeMessenger";
|
||||
import { useLastSessionContext } from "../context/LastSessionContext";
|
||||
import { defaultModelSelector } from "../redux/selectors/modelSelectors";
|
||||
import {
|
||||
abortStream,
|
||||
newSession,
|
||||
setInactive,
|
||||
} from "../redux/slices/stateSlice";
|
||||
import { newSession } from "../redux/slices/stateSlice";
|
||||
import { RootState } from "../redux/store";
|
||||
import { getLocalStorage, setLocalStorage } from "../util/localStorage";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue