Commit 15203141 by Liu

feat:若回答中包括['抱歉', 'LLM响应异常', 'QPM最大流量限制', '请求时间超时']时则不调用推荐问接口

parent 548b62d4
......@@ -16,6 +16,15 @@ export const ChatAnswerRecommend: React.FC<ChatAnswerRecommendProps> = ({ answer
const [loading, setLoading] = useState<boolean>(false)
const [searchParams] = useSearchParams()
const getAnswerRecommend = async () => {
// 若回答内容包含以下关键字,则不再请求推荐问题接口
const content = answer?.answer || ''
const blockKeywords = ['抱歉', 'LLM响应异常', 'QPM最大流量限制', '请求时间超时']
const shouldBlock = blockKeywords.some(keyword => content.includes(keyword))
if (shouldBlock) {
onLoadingChange?.(false)
return
}
setLoading(true)
onLoadingChange?.(true)
// 从 sessionStorage 中获取 toolId
......
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 to comment