From b16a7b0b3b96255640125873426915f301474646 Mon Sep 17 00:00:00 2001 From: Joel Date: Mon, 12 Jun 2023 16:37:03 +0800 Subject: [PATCH] feat: stop response call api (#340) --- web/app/components/app/chat/index.tsx | 4 +++- web/app/components/app/configuration/debug/index.tsx | 10 +++++++--- web/app/components/share/chat/index.tsx | 10 +++++++--- web/service/base.ts | 4 +++- web/service/debug.ts | 4 ++++ web/service/share.ts | 4 ++++ 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/web/app/components/app/chat/index.tsx b/web/app/components/app/chat/index.tsx index 591fca47b5..18cd5e9a28 100644 --- a/web/app/components/app/chat/index.tsx +++ b/web/app/components/app/chat/index.tsx @@ -53,6 +53,7 @@ export type IChatProps = { displayScene?: DisplayScene useCurrentUserAvatar?: boolean isResponsing?: boolean + canStopResponsing?: boolean abortResponsing?: () => void controlClearQuery?: number controlFocus?: number @@ -412,6 +413,7 @@ const Chat: FC = ({ displayScene, useCurrentUserAvatar, isResponsing, + canStopResponsing, abortResponsing, controlClearQuery, controlFocus, @@ -508,7 +510,7 @@ const Chat: FC = ({ { !isHideSendInput && (
- {isResponsing && ( + {(isResponsing && canStopResponsing) && (