Commit 1a336426 by xianlezheng Committed by GitHub

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

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

Co-authored-by: zhengxianle <nopanic@ilikejobs.com>
parent e9681c8e
...@@ -51,6 +51,7 @@ export const checkIsInteractiveByHistories = (chatHistories: ChatSiteItemType[]) ...@@ -51,6 +51,7 @@ export const checkIsInteractiveByHistories = (chatHistories: ChatSiteItemType[])
] as AIChatItemValueItemType; ] as AIChatItemValueItemType;
return ( return (
lastMessageValue &&
lastMessageValue.type === ChatItemValueTypeEnum.interactive && lastMessageValue.type === ChatItemValueTypeEnum.interactive &&
!!lastMessageValue?.interactive?.params && !!lastMessageValue?.interactive?.params &&
// 如果用户选择了,则不认为是交互模式(可能是上一轮以交互结尾,发起的新的一轮对话) // 如果用户选择了,则不认为是交互模式(可能是上一轮以交互结尾,发起的新的一轮对话)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment