diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 05d3d879..40510a8b 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -72,7 +72,7 @@ export const en = { modelManagement: 'Model Management', memoryStore: 'Memory Store', apiParameters: 'API Parameters', - userMemory: 'User Memory', + userMemory: 'Memory Store', memberManagement: 'Member Management', memorySummary: 'Memory Summary', memoryConversation: 'Memory Validation', @@ -1211,6 +1211,8 @@ export const en = { hire_date: 'Hire Date', memoryContent: 'Memory Content', created_at: 'Created At', + updated_at: 'Updated At', + fullScreen: 'Full Screen', memoryWindow: "{{name}}'s Window of Memory", memory_insight: 'Overall Overview', @@ -1237,7 +1239,7 @@ export const en = { unix: 'items', completeMemory: 'Complete Memory', relationshipEvolution: 'Relationship Evolution', - timelineMemories: 'Shared Memory Timeline', + timelineMemories: 'Long-term Memory', emotionLine: 'Emotion Changes Over Time', interaction: 'Interaction Frequency & Relationship Stages', timelines_memory: 'All', @@ -1600,11 +1602,9 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re enterJson: 'Enter JSON', jsonPlaceholder: 'Enter JSON data, e.g.: {"name": "test", "value": 123}', clear: 'Clear', - parse: 'Paste', - format: 'Format', - minify: 'Minify', - validate: 'Validate', - convert: 'Escape', + paste: 'Paste', + parse: 'Parse', + json_path: 'JSON Path Parameters', outputResult: 'Output Result', validJosn: 'JSON format is correct, validation passed!', @@ -1923,7 +1923,8 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re variableConfig: 'Variable Configuration', variableRequired: 'Required', addMessage: 'Add Message', - answerDesc: 'Reply' + answerDesc: 'Reply', + addNode: 'Add Node', }, emotionEngine: { emotionEngineConfig: 'Emotion Engine Configuration', diff --git a/web/src/i18n/zh.ts b/web/src/i18n/zh.ts index b065a19a..e1d87cf1 100644 --- a/web/src/i18n/zh.ts +++ b/web/src/i18n/zh.ts @@ -72,7 +72,7 @@ export const zh = { modelManagement: '模型管理', memoryStore: '记忆存储', apiParameters: 'API参数', - userMemory: '用户记忆', + userMemory: '记忆库', memberManagement: '成员管理', memorySummary: '记忆摘要', memoryConversation: '记忆验证', @@ -87,7 +87,7 @@ export const zh = { knowledgeShare: '详情', knowledgeCreateDataset: '新建数据集', knowledgeDocumentDetails: '详情', - userMemoryDetail: '用户记忆详情', + userMemoryDetail: '记忆库详情', toolManagement: '工具管理', emotionEngine: '情感引擎', statementDetail: '情绪记忆', @@ -1292,7 +1292,7 @@ export const zh = { updated_at: '最后更新时间', fullScreen: '全屏', - memoryWindow: "{{name}}的记忆之窗", + memoryWindow: "{{name}} 的记忆之窗", memory_insight: '总体概述', key_findings: '关键发现', behavior_pattern: '行为模式', @@ -1317,7 +1317,7 @@ export const zh = { unix: '个', completeMemory: '完整记忆', relationshipEvolution: '关系演化', - timelineMemories: '共同记忆时间线', + timelineMemories: '长期记忆', emotionLine: '情绪随时间变化', interaction: '互动频率 & 关系阶段', timelines_memory: '全部', @@ -1698,11 +1698,9 @@ export const zh = { enterJson: '输入JSON', jsonPlaceholder: '输入JSON数据,例如:{"name": "测试", "value": 123}', clear: '清空', - parse: '粘贴', - format: '格式化', - minify: '压缩', - validate: '验证', - convert: '转义', + paste: '粘贴', + parse: '解析', + json_path: 'JSON 路径参数', outputResult: '输出结果', validJosn: 'JSON格式正确,验证通过!', @@ -2022,7 +2020,8 @@ export const zh = { variableConfig: '变量配置', variableRequired: '必填', addMessage: '添加消息', - answerDesc: '回复' + answerDesc: '回复', + addNode: '添加节点', }, emotionEngine: { emotionEngineConfig: '情感引擎配置', diff --git a/web/src/views/ToolManagement/components/JsonToolModal.tsx b/web/src/views/ToolManagement/components/JsonToolModal.tsx index 165cfba8..894f4b54 100644 --- a/web/src/views/ToolManagement/components/JsonToolModal.tsx +++ b/web/src/views/ToolManagement/components/JsonToolModal.tsx @@ -1,5 +1,5 @@ import { forwardRef, useImperativeHandle, useState } from 'react'; -import { Form, Input, Button, Space, Tree } from 'antd'; +import { Form, Input, Button, Space } from 'antd'; import { useTranslation } from 'react-i18next'; import type { TreeDataNode } from 'antd'; @@ -12,7 +12,7 @@ import { execute } from '@/api/tools'; const JsonToolModal = forwardRef((_props, ref) => { const { t } = useTranslation(); const [visible, setVisible] = useState(false); - const [form] = Form.useForm<{ json: string; }>(); + const [form] = Form.useForm<{ json: string; json_path: string; }>(); const [data, setData] = useState({} as ToolItem) const [formatValue, setFormatValue] = useState | null>(null) @@ -60,44 +60,29 @@ const JsonToolModal = forwardRef((_props, ref) => { } const handleOperate = (type: string) => { const json = form.getFieldValue('json') + const json_path = form.getFieldValue('json_path') if (!json || !data.id) return let params: ExecuteData = { tool_id: data.id, parameters: { operation: type, - input_data: json + input_data: json, + json_path } } - if (type === 'format') { + if (type === 'parse') { params = { ...params, parameters: { ...params.parameters, - indent: 2, - ensure_ascii: false, - sort_keys: false } } } execute(params) .then(res => { - const { data } = res as {data: { - formatted_json: string; - minified_json: string; - is_valid: boolean; - converted_json: string; - error: string; - structure: Record - }} - switch (type) { - case 'format': - setFormatValue(data.formatted_json); - break - case 'minify': - setFormatValue(data.minified_json) - break - } + const { data } = res as { data: string; } + setFormatValue(data); }) } const clear = () => { @@ -126,15 +111,20 @@ const JsonToolModal = forwardRef((_props, ref) => { label={ {t('tool.enterJson')} - + } > + + + - - + ((_props, ref) => { const { t } = useTranslation(); @@ -88,8 +89,8 @@ const TimeToolModal = forwardRef((_props, ref) => { } }) .then(res => { - const response = res as { data: CurrentTimeObj } - setTimestampFormat(response.data.datetime) + const response = res as { data: string } + setTimestampFormat(response.data) }) } const handleChangeFormatType = () => { @@ -149,7 +150,7 @@ const TimeToolModal = forwardRef((_props, ref) => { - + diff --git a/web/src/views/ToolManagement/types.ts b/web/src/views/ToolManagement/types.ts index 6fd4e439..aa97db66 100644 --- a/web/src/views/ToolManagement/types.ts +++ b/web/src/views/ToolManagement/types.ts @@ -130,6 +130,7 @@ export interface ExecuteData { ensure_ascii?: boolean; sort_keys?: boolean; input_data?: string; + json_path?: string; } } export interface CustomToolModalRef {