feat(web): 🎨 Unified color theme, AntV light/dark theme switching, Antd first-screen style loading. (#1020)

Co-authored-by: 黄振洪 <hzh01509324@alibaba-inc.com>
Co-authored-by: Aralhi <xiaoping0501@gmail.com>
This commit is contained in:
Hzh_97
2024-01-12 09:44:52 +08:00
committed by GitHub
parent 2706e27ae5
commit 99ea6ac1a4
99 changed files with 1125 additions and 1410 deletions

View File

@@ -3,8 +3,12 @@ import { apiInterceptors, getDialogueList, getUsableModels } from '@/client/api'
import { useRequest } from 'ahooks';
import { ChatHistoryResponse, DialogueListResponse, IChatDialogueSchema } from '@/types/chat';
import { useSearchParams } from 'next/navigation';
import { STORAGE_THEME_KEY } from '@/utils';
type ThemeMode = 'dark' | 'light';
interface IChatContext {
mode: ThemeMode;
isContract?: boolean;
isMenuExpand?: boolean;
scene: IChatDialogueSchema['chat_mode'] | (string & {});
@@ -14,6 +18,7 @@ interface IChatContext {
modelList: Array<string>;
agentList: string[];
dialogueList?: DialogueListResponse;
setMode: (mode: ThemeMode) => void;
setAgentList?: (val: string[]) => void;
setModel: (val: string) => void;
setIsContract: (val: boolean) => void;
@@ -28,7 +33,14 @@ interface IChatContext {
setDocId: (docId: number) => void;
}
function getDefaultTheme(): ThemeMode {
const theme = localStorage.getItem(STORAGE_THEME_KEY) as ThemeMode;
if (theme) return theme;
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
}
const ChatContext = createContext<IChatContext>({
mode: 'light',
scene: '',
chatId: '',
modelList: [],
@@ -43,6 +55,7 @@ const ChatContext = createContext<IChatContext>({
setDbParam: () => void 0,
queryDialogueList: () => {},
refreshDialogList: () => {},
setMode: () => void 0,
history: [],
setHistory: () => {},
docId: undefined,
@@ -54,6 +67,7 @@ const ChatContextProvider = ({ children }: { children: React.ReactElement }) =>
const chatId = searchParams?.get('id') ?? '';
const scene = searchParams?.get('scene') ?? '';
const db_param = searchParams?.get('db_param') ?? '';
const [isContract, setIsContract] = useState(false);
const [model, setModel] = useState<string>('');
const [isMenuExpand, setIsMenuExpand] = useState<boolean>(scene !== 'chat_dashboard');
@@ -61,6 +75,7 @@ const ChatContextProvider = ({ children }: { children: React.ReactElement }) =>
const [agentList, setAgentList] = useState<string[]>([]);
const [history, setHistory] = useState<ChatHistoryResponse>([]);
const [docId, setDocId] = useState<number>();
const [mode, setMode] = useState<ThemeMode>();
const {
run: queryDialogueList,
@@ -80,6 +95,11 @@ const ChatContextProvider = ({ children }: { children: React.ReactElement }) =>
const [, res] = await apiInterceptors(getUsableModels());
return res ?? [];
});
useEffect(() => {
setMode(getDefaultTheme());
}, []);
useEffect(() => {
setModel(modelList[0]);
}, [modelList, modelList?.length]);
@@ -95,6 +115,8 @@ const ChatContextProvider = ({ children }: { children: React.ReactElement }) =>
dbParam: dbParam || db_param,
dialogueList,
agentList,
mode,
setMode,
setAgentList,
setModel,
setIsContract,

View File

@@ -1,377 +1,390 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
const resources = {
en: {
translation: {
Knowledge_Space: 'Knowledge',
space: 'space',
Vector: 'Vector',
Owner: 'Owner',
Count: 'Count',
File_type_Invalid: 'The file type is invalid',
Knowledge_Space_Config: 'Space Config',
Choose_a_Datasource_type: 'Datasource type',
Segmentation: 'Segmentation',
No_parameter: `No segementation parameter required.`,
Knowledge_Space_Name: 'Knowledge Space Name',
Please_input_the_name: 'Please input the name',
Please_input_the_owner: 'Please input the owner',
Please_select_file: 'Please select one file',
Description: 'Description',
Please_input_the_description: 'Please input the description',
Next: 'Next',
the_name_can_only_contain: 'the name can only contain numbers, letters, Chinese characters, "-" and "_"',
Text: 'Text',
'Fill your raw text': 'Fill your raw text',
URL: 'URL',
Fetch_the_content_of_a_URL: 'Fetch the content of a URL',
Document: 'Document',
Upload_a_document: 'Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown',
Name: 'Name',
Text_Source: 'Text Source(Optional)',
Please_input_the_text_source: 'Please input the text source',
Sync: 'Sync',
Back: 'Back',
Finish: 'Finish',
Web_Page_URL: 'Web Page URL',
Please_input_the_Web_Page_URL: 'Please input the Web Page URL',
Select_or_Drop_file: 'Select or Drop file',
Documents: 'Documents',
Chat: 'Chat',
Add_Datasource: 'Add Datasource',
Arguments: 'Arguments',
Type: 'Type',
Size: 'Size',
Last_Sync: 'Last Sync',
Status: 'Status',
Result: 'Result',
Details: 'Details',
Delete: 'Delete',
Operation: 'Operation',
Submit: 'Submit',
Chunks: 'Chunks',
Content: 'Content',
Meta_Data: 'Meta Data',
Please_select_a_file: 'Please select a file',
Please_input_the_text: 'Please input the text',
Embedding: 'Embedding',
topk: 'topk',
the_top_k_vectors: 'the top k vectors based on similarity score',
recall_score: 'recall_score',
Set_a_threshold_score: 'Set a threshold score for the retrieval of similar vectors',
recall_type: 'recall_type',
model: 'model',
A_model_used: 'A model used to create vector representations of text or other data',
Automatic: 'Automatic',
Process: 'Process',
Automatic_desc: 'Automatically set segmentation and preprocessing rules.',
chunk_size: 'chunk_size',
The_size_of_the_data_chunks: 'The size of the data chunks used in processing',
chunk_overlap: 'chunk_overlap',
The_amount_of_overlap: 'The amount of overlap between adjacent data chunks',
Prompt: 'Prompt',
scene: 'scene',
A_contextual_parameter: 'A contextual parameter used to define the setting or environment in which the prompt is being used',
template: 'template',
structure_or_format:
'A pre-defined structure or format for the prompt, which can help ensure that the AI system generates responses that are consistent with the desired style or tone.',
max_token: 'max_token',
max_iteration: 'max_iteration',
concurrency_limit: 'concurrency_limit',
The_maximum_number_of_tokens: 'The maximum number of tokens or words allowed in a prompt',
Theme: 'Theme',
Port: 'Port',
Username: 'Username',
Password: 'Password',
Remark: 'Remark',
Edit: 'Edit',
Database: 'Database',
Data_Source: 'Data Center',
Close_Sidebar: 'Fold',
Show_Sidebar: 'UnFold',
language: 'Language',
choose_model: 'Please choose a model',
data_center_desc: 'DB-GPT also offers a user-friendly data center management interface for efficient data maintenance.',
create_database: 'Create Database',
create_knowledge: 'Create Knowledge',
path: 'Path',
model_manage: 'Models',
stop_model_success: 'Stop model success',
create_model: 'Create Model',
model_select_tips: 'Please select a model',
submit: 'Submit',
close: 'Close',
start_model_success: 'Start model success',
download_model_tip: 'Please download model first.',
Plugins: 'Plugins',
try_again: 'Try again',
no_data: 'No data',
Open_Sidebar: 'Unfold',
cancel: 'Cancel',
Edit_Success: 'Edit Success',
Add: 'Add',
Add_Success: 'Add Success',
Error_Message: 'Something Error',
Please_Input: 'Please Input',
Prompt_Info_Scene: 'Scene',
Prompt_Info_Sub_Scene: 'Sub Scene',
Prompt_Info_Name: 'Name',
Prompt_Info_Content: 'Content',
Public: 'Public',
Private: 'Private',
Lowest: 'Lowest',
Missed: 'Missed',
Lost: 'Lost',
Incorrect: 'Incorrect',
Verbose: 'Verbose',
Best: 'Best',
Rating: 'Rating',
Q_A_Category: 'Q&A Category',
Q_A_Rating: 'Q&A Rating',
feed_back_desc:
'0: No results\n' +
'1: Results exist, but they are irrelevant, the question is not understood\n' +
'2: Results exist, the question is understood, but it indicates that the question cannot be answered\n' +
'3: Results exist, the question is understood, and an answer is given, but the answer is incorrect\n' +
'4: Results exist, the question is understood, the answer is correct, but it is verbose and lacks a summary\n' +
'5: Results exist, the question is understood, the answer is correct, the reasoning is correct, and a summary is provided, concise and to the point\n',
input_count: 'Total input',
input_unit: 'characters',
Copy: 'Copy',
Copy_success: 'Content copied successfully',
Copy_nothing: 'Content copied is empty',
Copry_error: 'Copy failed',
Click_Select: 'Click&Select',
Quick_Start: 'Quick Start',
Select_Plugins: 'Select Plugins',
Search: 'Search',
Update_From_Github: 'Upload From Github',
Reset: 'Reset',
Upload: 'Upload',
Market_Plugins: 'Market Plugin',
My_Plugins: 'My Plugins',
Del_Knowledge_Tips: 'Do you want delete the Space',
Del_Document_Tips: 'Do you want delete the Document',
Tips: 'Tips',
Limit_Upload_File_Count_Tips: 'Only one file can be uploaded at a time',
To_Plugin_Market: 'Go to the Plugin Market',
Summary: 'Summary',
stacked_column_chart: 'Stacked Column',
column_chart: 'Column',
percent_stacked_column_chart: 'Percent Stacked Column',
grouped_column_chart: 'Grouped Column',
time_column: 'Time Column',
pie_chart: 'Pie',
line_chart: 'Line',
area_chart: 'Area',
stacked_area_chart: 'Stacked Area',
scatter_plot: 'Scatter',
bubble_chart: 'Bubble',
stacked_bar_chart: 'Stacked Bar',
bar_chart: 'Bar',
percent_stacked_bar_chart: 'Percent Stacked Bar',
grouped_bar_chart: 'Grouped Bar',
water_fall_chart: 'Waterfall',
table: 'Table',
multi_line_chart: 'Multi Line',
multi_measure_column_chart: 'Multi Measure Column',
multi_measure_line_chart: 'Multi Measure Line',
Advices: 'Advices',
Retry: 'Retry',
Load_more: 'load more',
},
},
zh: {
translation: {
Knowledge_Space: '知识库',
space: '知识库',
Vector: '向量',
Owner: '创建人',
Count: '文档数',
File_type_Invalid: '文件类型错误',
Knowledge_Space_Config: '知识库配置',
Choose_a_Datasource_type: '知识库类型',
Segmentation: '分片',
No_parameter: '不需要配置分片参数',
Setup_the_Datasource: '处理',
Knowledge_Space_Name: '知识库名称',
Please_input_the_name: '请输入名称',
Please_input_the_owner: '请输入创建人',
Please_select_file: '请至少选择一个文件',
Description: '描述',
Please_input_the_description: '请输入描述',
Next: '下一步',
the_name_can_only_contain: '名称只能包含数字、字母、中文字符、-或_',
Text: '文本',
'Fill your raw text': '填写您的原始文本',
URL: '网址',
Fetch_the_content_of_a_URL: '获取 URL 的内容',
Document: '文档',
Upload_a_document: '上传文档文档类型可以是PDF、CSV、Text、PowerPoint、Word、Markdown',
Name: '名称',
Text_Source: '文本来源(可选)',
Please_input_the_text_source: '请输入文本来源',
Sync: '同步',
Back: '上一步',
Finish: '完成',
Web_Page_URL: '网页网址',
Please_input_the_Web_Page_URL: '请输入网页网址',
Select_or_Drop_file: '选择或拖拽文件',
Documents: '文档',
Chat: '对话',
Add_Datasource: '添加数据源',
Arguments: '参数',
Type: '类型',
Size: '切片',
Last_Sync: '上次同步时间',
Status: '状态',
Result: '结果',
Details: '明细',
Delete: '删除',
Operation: '操作',
Submit: '提交',
close: '关闭',
Chunks: '切片',
Content: '内容',
Meta_Data: '元数据',
Please_select_a_file: '请上传一个文件',
Please_input_the_text: '请输入文本',
Embedding: '嵌入',
topk: 'TopK',
the_top_k_vectors: '基于相似度得分的前 k 个向量',
recall_score: '召回分数',
Set_a_threshold_score: '设置相似向量检索的阈值分数',
recall_type: '召回类型',
model: '模型',
A_model_used: '用于创建文本或其他数据的矢量表示的模型',
Automatic: '自动切片',
Process: '切片处理',
Automatic_desc: '自动设置分割和预处理规则。',
chunk_size: '块大小',
The_size_of_the_data_chunks: '处理中使用的数据块的大小',
chunk_overlap: '块重叠',
The_amount_of_overlap: '相邻数据块之间的重叠量',
scene: '场景',
A_contextual_parameter: '用于定义使用提示的设置或环境的上下文参数',
template: '模板',
structure_or_format: '预定义的提示结构或格式,有助于确保人工智能系统生成与所需风格或语气一致的响应。',
max_token: '最大令牌',
max_iteration: '最大迭代',
concurrency_limit: '并发限制',
The_maximum_number_of_tokens: '提示中允许的最大标记或单词数',
Theme: '主题',
Port: '端口',
Username: '用户名',
Password: '密码',
Remark: '备注',
Edit: '编辑',
Database: '数据库',
Data_Source: '数据中心',
Close_Sidebar: '收起',
Show_Sidebar: '展开',
language: '语言',
choose_model: '请选择一个模型',
data_center_desc: 'DB-GPT支持数据库交互和基于文档的对话它还提供了一个用户友好的数据中心管理界面。',
create_database: '创建数据库',
create_knowledge: '创建知识库',
path: '路径',
model_manage: '模型管理',
stop_model_success: '模型停止成功',
create_model: '创建模型',
model_select_tips: '请选择一个模型',
submit: '提交',
start_model_success: '启动模型成功',
download_model_tip: '请先下载模型',
Plugins: '插件列表',
try_again: '刷新重试',
no_data: '暂无数据',
Prompt: '提示语',
Open_Sidebar: '展开',
cancel: '取消',
Edit_Success: '编辑成功',
Add: '新增',
Add_Success: '新增成功',
Error_Message: '出错了',
Please_Input: '请输入',
Prompt_Info_Scene: '场景',
Prompt_Info_Sub_Scene: '次级场景',
Prompt_Info_Name: '名称',
Prompt_Info_Content: '内容',
Public: '公共',
Private: '私有',
Lowest: '渣渣',
Missed: '没理解',
Lost: '答不了',
Incorrect: '答错了',
Verbose: '较啰嗦',
Best: '真棒',
Rating: '评分',
Q_A_Category: '问答类别',
Q_A_Rating: '问答评分',
feed_back_desc:
'0: 无结果\n' +
'1: 有结果,但是在文不对题,没有理解问题\n' +
'2: 有结果,理解了问题,但是提示回答不了这个问题\n' +
'3: 有结果,理解了问题,并做出回答,但是回答的结果错误\n' +
'4: 有结果,理解问题,回答结果正确,但是比较啰嗦,缺乏总结\n' +
'5: 有结果,理解了问题,回答结果正确,推理正确,并给出了总结,言简意赅\n',
input_count: '共计输入',
input_unit: '字',
Copy: '复制',
Copy_success: '内容复制成功',
Copy_nothing: '内容复制为空',
Copry_error: '复制失败',
Click_Select: '点击选择',
Quick_Start: '快速开始',
Select_Plugins: '选择插件',
Search: '搜索',
Reset: '重置',
Update_From_Github: '更新Github插件',
Upload: '上传',
Market_Plugins: '插件市场',
My_Plugins: '我的插件',
Del_Knowledge_Tips: '你确定删除该知识库吗',
Del_Document_Tips: '你确定删除该文档吗',
Tips: '提示',
Limit_Upload_File_Count_Tips: '一次只能上传一个文件',
To_Plugin_Market: '前往插件市场',
Summary: '总结',
stacked_column_chart: '堆叠柱状图',
column_chart: '柱状图',
percent_stacked_column_chart: '百分比堆叠柱状图',
grouped_column_chart: '簇形柱状图',
time_column: '簇形柱状图',
pie_chart: '图',
line_chart: '折线图',
area_chart: '面积图',
stacked_area_chart: '堆叠面积图',
scatter_plot: '散点图',
bubble_chart: '气泡图',
stacked_bar_chart: '堆叠条形图',
bar_chart: '条形图',
percent_stacked_bar_chart: '百分比堆叠条形图',
grouped_bar_chart: '簇形条形图',
water_fall_chart: '瀑布图',
table: '表格',
multi_line_chart: '多折线图',
multi_measure_column_chart: '多指标柱形图',
multi_measure_line_chart: '多指标折线图',
Advices: '自动推荐',
Retry: '重试',
Load_more: '加载更多',
},
},
};
const en = {
Knowledge_Space: 'Knowledge',
space: 'space',
Vector: 'Vector',
Owner: 'Owner',
Count: 'Count',
File_type_Invalid: 'The file type is invalid',
Knowledge_Space_Config: 'Space Config',
Choose_a_Datasource_type: 'Datasource type',
Segmentation: 'Segmentation',
No_parameter: `No segementation parameter required.`,
Knowledge_Space_Name: 'Knowledge Space Name',
Please_input_the_name: 'Please input the name',
Please_input_the_owner: 'Please input the owner',
Please_select_file: 'Please select one file',
Description: 'Description',
Please_input_the_description: 'Please input the description',
Next: 'Next',
the_name_can_only_contain: 'the name can only contain numbers, letters, Chinese characters, "-" and "_"',
Text: 'Text',
'Fill your raw text': 'Fill your raw text',
URL: 'URL',
Fetch_the_content_of_a_URL: 'Fetch the content of a URL',
Document: 'Document',
Upload_a_document: 'Upload a document, document type can be PDF, CSV, Text, PowerPoint, Word, Markdown',
Name: 'Name',
Text_Source: 'Text Source(Optional)',
Please_input_the_text_source: 'Please input the text source',
Sync: 'Sync',
Back: 'Back',
Finish: 'Finish',
Web_Page_URL: 'Web Page URL',
Please_input_the_Web_Page_URL: 'Please input the Web Page URL',
Select_or_Drop_file: 'Select or Drop file',
Documents: 'Documents',
Chat: 'Chat',
Add_Datasource: 'Add Datasource',
Arguments: 'Arguments',
Type: 'Type',
Size: 'Size',
Last_Sync: 'Last Sync',
Status: 'Status',
Result: 'Result',
Details: 'Details',
Delete: 'Delete',
Operation: 'Operation',
Submit: 'Submit',
Chunks: 'Chunks',
Content: 'Content',
Meta_Data: 'Meta Data',
Please_select_a_file: 'Please select a file',
Please_input_the_text: 'Please input the text',
Embedding: 'Embedding',
topk: 'topk',
the_top_k_vectors: 'the top k vectors based on similarity score',
recall_score: 'recall_score',
Set_a_threshold_score: 'Set a threshold score for the retrieval of similar vectors',
recall_type: 'recall_type',
model: 'model',
A_model_used: 'A model used to create vector representations of text or other data',
Automatic: 'Automatic',
Process: 'Process',
Automatic_desc: 'Automatically set segmentation and preprocessing rules.',
chunk_size: 'chunk_size',
The_size_of_the_data_chunks: 'The size of the data chunks used in processing',
chunk_overlap: 'chunk_overlap',
The_amount_of_overlap: 'The amount of overlap between adjacent data chunks',
Prompt: 'Prompt',
scene: 'scene',
A_contextual_parameter: 'A contextual parameter used to define the setting or environment in which the prompt is being used',
template: 'template',
structure_or_format:
'A pre-defined structure or format for the prompt, which can help ensure that the AI system generates responses that are consistent with the desired style or tone.',
max_token: 'max_token',
max_iteration: 'max_iteration',
concurrency_limit: 'concurrency_limit',
The_maximum_number_of_tokens: 'The maximum number of tokens or words allowed in a prompt',
Theme: 'Theme',
Port: 'Port',
Username: 'Username',
Password: 'Password',
Remark: 'Remark',
Edit: 'Edit',
Database: 'Database',
Data_Source: 'Data Center',
Close_Sidebar: 'Fold',
Show_Sidebar: 'UnFold',
language: 'Language',
choose_model: 'Please choose a model',
data_center_desc: 'DB-GPT also offers a user-friendly data center management interface for efficient data maintenance.',
create_database: 'Create Database',
create_knowledge: 'Create Knowledge',
path: 'Path',
model_manage: 'Models',
stop_model_success: 'Stop model success',
create_model: 'Create Model',
model_select_tips: 'Please select a model',
submit: 'Submit',
close: 'Close',
start_model_success: 'Start model success',
download_model_tip: 'Please download model first.',
Plugins: 'Plugins',
try_again: 'Try again',
no_data: 'No data',
Open_Sidebar: 'Unfold',
cancel: 'Cancel',
Edit_Success: 'Edit Success',
Add: 'Add',
Add_Success: 'Add Success',
Error_Message: 'Something Error',
Please_Input: 'Please Input',
Prompt_Info_Scene: 'Scene',
Prompt_Info_Sub_Scene: 'Sub Scene',
Prompt_Info_Name: 'Name',
Prompt_Info_Content: 'Content',
Public: 'Public',
Private: 'Private',
Lowest: 'Lowest',
Missed: 'Missed',
Lost: 'Lost',
Incorrect: 'Incorrect',
Verbose: 'Verbose',
Best: 'Best',
Rating: 'Rating',
Q_A_Category: 'Q&A Category',
Q_A_Rating: 'Q&A Rating',
feed_back_desc:
'0: No results\n' +
'1: Results exist, but they are irrelevant, the question is not understood\n' +
'2: Results exist, the question is understood, but it indicates that the question cannot be answered\n' +
'3: Results exist, the question is understood, and an answer is given, but the answer is incorrect\n' +
'4: Results exist, the question is understood, the answer is correct, but it is verbose and lacks a summary\n' +
'5: Results exist, the question is understood, the answer is correct, the reasoning is correct, and a summary is provided, concise and to the point\n',
input_count: 'Total input',
input_unit: 'characters',
Copy: 'Copy',
Copy_success: 'Content copied successfully',
Copy_nothing: 'Content copied is empty',
Copry_error: 'Copy failed',
Click_Select: 'Click&Select',
Quick_Start: 'Quick Start',
Select_Plugins: 'Select Plugins',
Search: 'Search',
Update_From_Github: 'Upload From Github',
Reset: 'Reset',
Upload: 'Upload',
Market_Plugins: 'Market Plugin',
My_Plugins: 'My Plugins',
Del_Knowledge_Tips: 'Do you want delete the Space',
Del_Document_Tips: 'Do you want delete the Document',
Tips: 'Tips',
Limit_Upload_File_Count_Tips: 'Only one file can be uploaded at a time',
To_Plugin_Market: 'Go to the Plugin Market',
Summary: 'Summary',
stacked_column_chart: 'Stacked Column',
column_chart: 'Column',
percent_stacked_column_chart: 'Percent Stacked Column',
grouped_column_chart: 'Grouped Column',
time_column: 'Time Column',
pie_chart: 'Pie',
line_chart: 'Line',
area_chart: 'Area',
stacked_area_chart: 'Stacked Area',
scatter_plot: 'Scatter',
bubble_chart: 'Bubble',
stacked_bar_chart: 'Stacked Bar',
bar_chart: 'Bar',
percent_stacked_bar_chart: 'Percent Stacked Bar',
grouped_bar_chart: 'Grouped Bar',
water_fall_chart: 'Waterfall',
table: 'Table',
multi_line_chart: 'Multi Line',
multi_measure_column_chart: 'Multi Measure Column',
multi_measure_line_chart: 'Multi Measure Line',
Advices: 'Advices',
Retry: 'Retry',
Load_more: 'load more',
new_chat: 'New Chat',
} as const;
type I18nKeys = keyof typeof en;
export interface Resources {
translation: Record<I18nKeys, string>;
}
const zh: Resources['translation'] = {
Knowledge_Space: '知识库',
space: '知识库',
Vector: '向量',
Owner: '创建人',
Count: '文档数',
File_type_Invalid: '文件类型错误',
Knowledge_Space_Config: '知识库配置',
Choose_a_Datasource_type: '知识库类型',
Segmentation: '分片',
No_parameter: '不需要配置分片参数',
Knowledge_Space_Name: '知识库名称',
Please_input_the_name: '请输入名称',
Please_input_the_owner: '请输入创建人',
Please_select_file: '请至少选择一个文件',
Description: '描述',
Please_input_the_description: '请输入描述',
Next: '下一步',
the_name_can_only_contain: '名称只能包含数字、字母、中文字符、-或_',
Text: '文本',
'Fill your raw text': '填写您的原始文本',
URL: '网址',
Fetch_the_content_of_a_URL: '获取 URL 的内容',
Document: '文',
Upload_a_document: '上传文档文档类型可以是PDF、CSV、Text、PowerPoint、Word、Markdown',
Name: '名称',
Text_Source: '文本来源(可选)',
Please_input_the_text_source: '请输入文本来源',
Sync: '同步',
Back: '上一步',
Finish: '完成',
Web_Page_URL: '网页网址',
Please_input_the_Web_Page_URL: '请输入网页网址',
Select_or_Drop_file: '选择或拖拽文件',
Documents: '文档',
Chat: '对话',
Add_Datasource: '添加数据源',
Arguments: '参数',
Type: '类型',
Size: '切片',
Last_Sync: '上次同步时间',
Status: '状态',
Result: '结果',
Details: '明细',
Delete: '删除',
Operation: '操作',
Submit: '提交',
close: '关闭',
Chunks: '切片',
Content: '内容',
Meta_Data: '元数据',
Please_select_a_file: '请上传一个文件',
Please_input_the_text: '请输入文本',
Embedding: '嵌入',
topk: 'TopK',
the_top_k_vectors: '基于相似度得分的前 k 个向量',
recall_score: '召回分数',
Set_a_threshold_score: '设置相似向量检索的阈值分数',
recall_type: '召回类型',
model: '模型',
A_model_used: '用于创建文本或其他数据的矢量表示的模型',
Automatic: '自动切片',
Process: '切片处理',
Automatic_desc: '自动设置分割和预处理规则。',
chunk_size: '块大小',
The_size_of_the_data_chunks: '处理中使用的数据块的大小',
chunk_overlap: '块重叠',
The_amount_of_overlap: '相邻数据块之间的重叠量',
scene: '场景',
A_contextual_parameter: '用于定义使用提示的设置或环境的上下文参数',
template: '模板',
structure_or_format: '预定义的提示结构或格式,有助于确保人工智能系统生成与所需风格或语气一致的响应。',
max_token: '最大令牌',
max_iteration: '最大迭代',
concurrency_limit: '并发限制',
The_maximum_number_of_tokens: '提示中允许的最大标记或单词数',
Theme: '主题',
Port: '端口',
Username: '用户名',
Password: '密码',
Remark: '备注',
Edit: '编辑',
Database: '数据库',
Data_Source: '数据中心',
Close_Sidebar: '收起',
Show_Sidebar: '展开',
language: '语言',
choose_model: '请选择一个模型',
data_center_desc: 'DB-GPT支持数据库交互和基于文档的对话它还提供了一个用户友好的数据中心管理界面。',
create_database: '创建数据库',
create_knowledge: '创建知识库',
path: '路径',
model_manage: '模型管理',
stop_model_success: '模型停止成功',
create_model: '创建模型',
model_select_tips: '请选择一个模型',
submit: '提交',
start_model_success: '启动模型成功',
download_model_tip: '请先下载模型!',
Plugins: '插件列表',
try_again: '刷新重试',
no_data: '暂无数据',
Prompt: '提示语',
Open_Sidebar: '展开',
cancel: '取消',
Edit_Success: '编辑成功',
Add: '新增',
Add_Success: '新增成功',
Error_Message: '出错了',
Please_Input: '请输入',
Prompt_Info_Scene: '场景',
Prompt_Info_Sub_Scene: '次级场景',
Prompt_Info_Name: '名称',
Prompt_Info_Content: '内容',
Public: '公共',
Private: '私有',
Lowest: '渣渣',
Missed: '没理解',
Lost: '答不了',
Incorrect: '答错了',
Verbose: '较啰嗦',
Best: '真棒',
Rating: '评分',
Q_A_Category: '问答类别',
Q_A_Rating: '问答评分',
feed_back_desc:
'0: 无结果\n' +
'1: 有结果,但是在文不对题,没有理解问题\n' +
'2: 有结果,理解了问题,但是提示回答不了这个问题\n' +
'3: 有结果,理解了问题,并做出回答,但是回答的结果错误\n' +
'4: 有结果,理解了问题,回答结果正确,但是比较啰嗦,缺乏总结\n' +
'5: 有结果,理解了问题,回答结果正确,推理正确,并给出了总结,言简意赅\n',
input_count: '共计输入',
input_unit: '',
Copy: '复制',
Copy_success: '内容复制成功',
Copy_nothing: '内容复制为空',
Copry_error: '复制失败',
Click_Select: '点击选择',
Quick_Start: '快速开始',
Select_Plugins: '选择插件',
Search: '搜索',
Reset: '重置',
Update_From_Github: '更新Github插件',
Upload: '上传',
Market_Plugins: '插件市场',
My_Plugins: '我的插件',
Del_Knowledge_Tips: '你确定删除该知识库吗',
Del_Document_Tips: '你确定删除该文档吗',
Tips: '提示',
Limit_Upload_File_Count_Tips: '一次只能上传一个文件',
To_Plugin_Market: '前往插件市场',
Summary: '总结',
stacked_column_chart: '堆叠柱状图',
column_chart: '柱状图',
percent_stacked_column_chart: '百分比堆叠柱状图',
grouped_column_chart: '簇形柱状图',
time_column: '簇形柱状图',
pie_chart: '图',
line_chart: '折线图',
area_chart: '面积图',
stacked_area_chart: '堆叠面积图',
scatter_plot: '散点图',
bubble_chart: '气泡图',
stacked_bar_chart: '堆叠条形图',
bar_chart: '条形图',
percent_stacked_bar_chart: '百分比堆叠条形图',
grouped_bar_chart: '簇形条形图',
water_fall_chart: '瀑布图',
table: '表格',
multi_line_chart: '多折线图',
multi_measure_column_chart: '多指标柱形图',
multi_measure_line_chart: '多指标折线图',
Advices: '自动推荐',
Retry: '重试',
Load_more: '加载更多',
new_chat: '创建会话',
} as const;
i18n.use(initReactI18next).init({
resources,
resources: {
en: {
translation: en,
},
zh: {
translation: zh,
},
},
lng: 'en',
interpolation: {
escapeValue: false,
},
});
export type I18nKeyMapper = (typeof resources)['en']['translation'];
export default i18n;
declare module 'i18next' {
interface CustomTypeOptions {
resources: Resources;
}
}