+
- }
- query={query}
+ empty={}
+ contentClassName="rb:h-[calc(100%-152px)]"
data={chatList}
+ streamLoading={streamLoading}
loading={loading}
- onChange={setQuery}
+ onChange={setMessage}
onSend={handleSend}
- />
+ labelFormat={(item) => dayjs(item.created_at).locale('en').format('MMMM D, YYYY [at] h:mm A')}
+ >
+
+
)
diff --git a/web/src/views/Conversation/types.ts b/web/src/views/Conversation/types.ts
index f1fb199e..b1f28879 100644
--- a/web/src/views/Conversation/types.ts
+++ b/web/src/views/Conversation/types.ts
@@ -10,4 +10,12 @@ export interface HistoryItem {
is_active: boolean;
created_at: number;
updated_at: number;
+}
+
+export interface QueryParams {
+ message?: string;
+ web_search?: boolean;
+ memory?: boolean;
+ stream: boolean;
+ conversation_id?: string | null;
}
\ No newline at end of file
diff --git a/web/src/views/EmotionEngine/index.tsx b/web/src/views/EmotionEngine/index.tsx
new file mode 100644
index 00000000..ae1cd4c6
--- /dev/null
+++ b/web/src/views/EmotionEngine/index.tsx
@@ -0,0 +1,252 @@
+import React, { useState, useEffect } from 'react';
+import { Row, Col, Form, Slider, Button, Alert, message, Switch, Space } from 'antd';
+import { useParams } from 'react-router-dom';
+import { useTranslation } from 'react-i18next';
+import RbCard from '@/components/RbCard/Card';
+import strategyImpactSimulator from '@/assets/images/memory/strategyImpactSimulator.svg'
+import { getMemoryEmotionConfig, updateMemoryEmotionConfig } from '@/api/memory'
+import type { ConfigForm } from './types'
+import CustomSelect from '@/components/CustomSelect';
+import { getModelListUrl } from '@/api/models'
+import Tag from '@/components/Tag'
+
+const configList = [
+ {
+ key: 'emotion_enabled',
+ type: 'switch',
+ },
+ {
+ key: 'emotion_model_id',
+ type: 'customSelect',
+ url: getModelListUrl,
+ params: { type: 'chat,llm', page: 1, pagesize: 100 }, // chat,llm
+ },
+ {
+ key: 'emotion_min_intensity',
+ type: 'slider',
+ min: 0,
+ max: 1,
+ step: 0.05
+ },
+ {
+ key: 'emotion_extract_keywords',
+ type: 'switch',
+ hasSubTitle: true
+ },
+ {
+ key: 'emotion_enable_subject',
+ type: 'switch',
+ hasSubTitle: true
+ },
+]
+
+const EmotionEngine: React.FC = () => {
+ const { t } = useTranslation();
+ const { id } = useParams();
+ const [configData, setConfigData] = useState
({} as ConfigForm);
+ const [form] = Form.useForm();
+ const [messageApi, contextHolder] = message.useMessage();
+ const [loading, setLoading] = useState(false)
+
+ const values = Form.useWatch([], form);
+
+ useEffect(() => {
+ getConfigData()
+ }, [id])
+
+ const getConfigData = () => {
+ if (!id) {
+ return
+ }
+ getMemoryEmotionConfig(id)
+ .then((res) => {
+ const response = res as ConfigForm
+ const initialValues = {
+ ...response,
+ }
+ setConfigData(initialValues);
+ form.setFieldsValue(initialValues);
+ })
+ .catch(() => {
+ console.error('Failed to load data');
+ })
+ }
+ const handleReset = () => {
+ form.setFieldsValue(configData);
+ }
+ const handleSave = () => {
+ if (!id) {
+ return
+ }
+ setLoading(true)
+ updateMemoryEmotionConfig({
+ ...values,
+ config_id: id
+ })
+ .then(() => {
+ messageApi.success(t('common.saveSuccess'))
+ setConfigData({...(values || {})})
+ })
+ .finally(() => {
+ setLoading(false)
+ })
+ }
+
+ return (
+
+
+
+
+ {t('emotionEngine.emotionEngineConfig')}
+