Fixs:当最后一条数据因大模型没返回数据时导致调试时前端报错。 (#2637)

在lastMessageValue取值时需要提前判断空值。

Co-authored-by: zhengxianle <nopanic@ilikejobs.com>
This commit is contained in:
xianlezheng
2024-09-08 15:26:05 +08:00
committed by GitHub
parent e9681c8ed5
commit 1a33642635

View File

@@ -51,6 +51,7 @@ export const checkIsInteractiveByHistories = (chatHistories: ChatSiteItemType[])
] as AIChatItemValueItemType;
return (
lastMessageValue &&
lastMessageValue.type === ChatItemValueTypeEnum.interactive &&
!!lastMessageValue?.interactive?.params &&
// 如果用户选择了,则不认为是交互模式(可能是上一轮以交互结尾,发起的新的一轮对话)