Skip to content

Commit

Permalink
Fixs:当最后一条数据因大模型没返回数据时导致调试时前端报错。 (labring#2637)
Browse files Browse the repository at this point in the history
在lastMessageValue取值时需要提前判断空值。

Co-authored-by: zhengxianle <nopanic@ilikejobs.com>
  • Loading branch information
xianlezheng and zhengxianle authored Sep 8, 2024
1 parent e9681c8 commit 1a33642
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export const checkIsInteractiveByHistories = (chatHistories: ChatSiteItemType[])
] as AIChatItemValueItemType;

return (
lastMessageValue &&
lastMessageValue.type === ChatItemValueTypeEnum.interactive &&
!!lastMessageValue?.interactive?.params &&
// 如果用户选择了,则不认为是交互模式(可能是上一轮以交互结尾,发起的新的一轮对话)
Expand Down

0 comments on commit 1a33642

Please sign in to comment.