Merge pull request #439 from SuanmoSuanyangTechnology/fix/memory_web_zy

fix(web): Implicit detail add check data api
This commit is contained in:
yingzhao
2026-03-03 15:21:32 +08:00
committed by GitHub
4 changed files with 25 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
/*
* @Author: ZhaoYing
* @Date: 2026-02-03 14:00:06
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-03 14:00:06
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-03 14:58:32
*/
import { request } from '@/utils/request'
import type {
@@ -163,9 +163,14 @@ export const getImplicitInterestAreas = (end_user_id: string) => {
export const getImplicitHabits = (end_user_id: string) => {
return request.get(`/memory/implicit-memory/habits/${end_user_id}`)
}
// Implicit Memory - Generate user portrait
export const generateProfile = (end_user_id: string) => {
return request.post(`/memory/implicit-memory/generate_profile`, { end_user_id })
}
// Implicit Memory - Check if data exists
export const implicitCheckData = (end_user_id: string) => {
return request.get(`/memory/implicit-memory/check-data/${end_user_id}`)
}
// Short-term memory
export const getShortTerm = (end_user_id: string) => {
return request.get(`/memory/short/short_term`, { end_user_id })

View File

@@ -2522,7 +2522,8 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re
context_details: 'Preference Details',
supporting_evidence: 'Preference Source',
specific_examples: 'Source',
wordEmpty: 'Click on a node in the left chart to view preference details'
wordEmpty: 'Click on a node in the left chart to view preference details',
noData: 'Portrait data does not exist, please click the refresh button in the top right corner to initialize',
},
shortTermDetail: {
title: 'Short-term memory is the "workbench" of the AI system, connecting instant conversations with long-term knowledge bases. Through real-time capture, deep retrieval, intelligent extraction and filtering transformation, temporary unstructured information is converted into valuable long-term knowledge.',

View File

@@ -2518,7 +2518,8 @@ export const zh = {
context_details: '偏好详情',
supporting_evidence: '偏好来源',
specific_examples: '来源',
wordEmpty: '点击左侧图表中的节点查看偏好详情'
wordEmpty: '点击左侧图表中的节点查看偏好详情',
noData: '画像数据不存在,请点击右上角刷新进行初始化',
},
shortTermDetail: {
title: '短期记忆是AI系统的"工作台",连接即时对话与长期知识库。通过实时捕获、深度检索、智能提取和筛选转化,将临时的非结构化信息转化为有价值的长期知识。',

View File

@@ -1,6 +1,6 @@
import { forwardRef, useImperativeHandle, useRef } from 'react'
import { forwardRef, useImperativeHandle, useRef, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Row, Col } from 'antd'
import { Row, Col, App } from 'antd'
import { useParams } from 'react-router-dom'
import Preferences from '../components/Preferences'
@@ -9,15 +9,27 @@ import InterestAreas from '../components/InterestAreas'
import Habits from '../components/Habits'
import {
generateProfile,
implicitCheckData,
} from '@/api/memory'
const ImplicitDetail = forwardRef<{ handleRefresh: () => void; }>((_props, ref) => {
const { t } = useTranslation()
const { id } = useParams()
const { message } = App.useApp()
const preferencesRef = useRef<{ handleRefresh: () => void; }>(null)
const portraitRef = useRef<{ handleRefresh: () => void; }>(null)
const interestAreasRef = useRef<{ handleRefresh: () => void; }>(null)
const habitsRef = useRef<{ handleRefresh: () => void; }>(null)
useEffect(() => {
if (!id) return
implicitCheckData(id)
.then(res => {
if (!(res as { exists: boolean }).exists) {
message.warning(t('implicitDetail.noData'))
}
})
}, [id])
const handleRefresh = () => {
if (!id) {