Merge pull request #800 from SuanmoSuanyangTechnology/feature/ui_upgrade_zy
Feature/UI upgrade zy
This commit is contained in:
@@ -1270,6 +1270,7 @@ export const en = {
|
||||
participle: 'Participle retrieval',
|
||||
semantic: 'Semantic retrieval',
|
||||
hybrid: 'Hybrid Retrieval',
|
||||
graph: 'Graph Retrieval',
|
||||
|
||||
similarity_threshold: 'Semantic similarity threshold',
|
||||
similarity_threshold_desc: 'Only return results with semantic similarity higher than this threshold',
|
||||
|
||||
@@ -657,6 +657,7 @@ export const zh = {
|
||||
participle: '分词检索',
|
||||
semantic: '语义检索',
|
||||
hybrid: '混合检索',
|
||||
graph: '图谱检索',
|
||||
|
||||
similarity_threshold: '语义相似度阈值',
|
||||
similarity_threshold_desc: '仅返回语义相似度高于此阈值的结果',
|
||||
|
||||
@@ -32,7 +32,7 @@ interface KnowledgeConfigModalProps {
|
||||
/**
|
||||
* Available retrieval types
|
||||
*/
|
||||
const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid']
|
||||
const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid', 'graph']
|
||||
|
||||
/**
|
||||
* Modal for configuring knowledge base retrieval settings
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 16:25:53
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-02-03 16:25:53
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-04-07 17:16:47
|
||||
*/
|
||||
/**
|
||||
* Type definitions for knowledge base configuration in application settings
|
||||
@@ -28,7 +28,7 @@ export interface RerankerConfig {
|
||||
* - semantic: Semantic similarity based retrieval
|
||||
* - hybrid: Combination of both methods
|
||||
*/
|
||||
export type RetrieveType = 'participle' | 'semantic' | 'hybrid'
|
||||
export type RetrieveType = 'participle' | 'semantic' | 'hybrid' | 'graph'
|
||||
|
||||
/**
|
||||
* Knowledge base configuration form data
|
||||
|
||||
@@ -52,7 +52,7 @@ const InitialValuePlugin: React.FC<InitialValuePluginProps> = ({ value, options
|
||||
const root = $getRoot();
|
||||
root.clear();
|
||||
|
||||
const parts = value.split(/(\{\{[^}]+\}\}|\n)/);
|
||||
const parts = (value ?? '').split(/(\{\{[^}]+\}\}|\n)/);
|
||||
let paragraph = $createParagraphNode();
|
||||
|
||||
parts.forEach(part => {
|
||||
|
||||
@@ -12,7 +12,7 @@ const FormItem = Form.Item;
|
||||
interface KnowledgeConfigModalProps {
|
||||
refresh: (values: KnowledgeConfigForm, type: 'knowledgeConfig') => void;
|
||||
}
|
||||
const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid']
|
||||
const retrieveTypes: RetrieveType[] = ['participle', 'semantic', 'hybrid', 'graph']
|
||||
|
||||
const KnowledgeConfigModal = forwardRef<KnowledgeConfigModalRef, KnowledgeConfigModalProps>(({
|
||||
refresh,
|
||||
|
||||
@@ -5,7 +5,7 @@ export interface RerankerConfig {
|
||||
reranker_id?: string | undefined;
|
||||
reranker_top_k?: number | undefined;
|
||||
}
|
||||
export type RetrieveType = 'participle' | 'semantic' | 'hybrid'
|
||||
export type RetrieveType = 'participle' | 'semantic' | 'hybrid' | 'graph'
|
||||
export interface KnowledgeConfigForm {
|
||||
kb_id?: string;
|
||||
similarity_threshold?: number;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { type FC, useEffect, useState, useMemo } from "react";
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Form, Select, InputNumber, Switch, Cascader, type CascaderProps, Tooltip } from 'antd'
|
||||
import { Form, Select, Switch, Cascader, type CascaderProps, Tooltip } from 'antd'
|
||||
import type { Suggestion } from '../../Editor/plugin/AutocompletePlugin'
|
||||
import { getToolMethods, getToolDetail, getTools } from '@/api/tools'
|
||||
import type { ToolType, ToolItem } from '@/views/ToolManagement/types'
|
||||
@@ -171,14 +171,15 @@ const ToolConfig: FC<{ options: Suggestion[]; }> = ({
|
||||
const filterChild = vo.children.filter(child => child.dataType === 'number')
|
||||
|
||||
if (filterChild.length > 0) {
|
||||
list.push({ ...vo, children: filterChild })
|
||||
} else {
|
||||
list.push({ ...vo, disabled: vo.dataType !== 'number', children: filterChild })
|
||||
} else if (vo.dataType === 'number') {
|
||||
list.push({ ...vo, children: [] })
|
||||
}
|
||||
} else {
|
||||
} else if (vo.dataType === 'number') {
|
||||
list.push({ ...vo })
|
||||
}
|
||||
})
|
||||
console.log('options', options, list)
|
||||
return list
|
||||
}, [options])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user