Skip to content

Commit 46f5c47

Browse files
committed
feat: add ToolTypeTranslations for multilingual support in tool types
1 parent 5bed9a3 commit 46f5c47

File tree

2 files changed

+67
-2
lines changed

2 files changed

+67
-2
lines changed

modules/tool/type/tool.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,70 @@ export enum ToolTypeEnum {
9191
other = 'other'
9292
}
9393

94+
/* Tool config is passed to FastGPT */
95+
export const ToolTypeTranslations = {
96+
[ToolTypeEnum.tools]: {
97+
en: 'tools',
98+
'zh-CN': '工具',
99+
'zh-Hant': '工具'
100+
},
101+
[ToolTypeEnum.search]: {
102+
en: 'search',
103+
'zh-CN': '搜索',
104+
'zh-Hant': '搜尋'
105+
},
106+
[ToolTypeEnum.multimodal]: {
107+
en: 'multimodal',
108+
'zh-CN': '多模态',
109+
'zh-Hant': '多模態'
110+
},
111+
[ToolTypeEnum.communication]: {
112+
en: 'communication',
113+
'zh-CN': '通信',
114+
'zh-Hant': '通信'
115+
},
116+
[ToolTypeEnum.finance]: {
117+
en: 'finance',
118+
'zh-CN': '金融',
119+
'zh-Hant': '金融'
120+
},
121+
[ToolTypeEnum.design]: {
122+
en: 'design',
123+
'zh-CN': '设计',
124+
'zh-Hant': '設計'
125+
},
126+
[ToolTypeEnum.productivity]: {
127+
en: 'productivity',
128+
'zh-CN': '生产力',
129+
'zh-Hant': '生產力'
130+
},
131+
[ToolTypeEnum.news]: {
132+
en: 'news',
133+
'zh-CN': '新闻',
134+
'zh-Hant': '新聞'
135+
},
136+
[ToolTypeEnum.entertainment]: {
137+
en: 'entertainment',
138+
'zh-CN': '娱乐',
139+
'zh-Hant': '娛樂'
140+
},
141+
[ToolTypeEnum.social]: {
142+
en: 'social',
143+
'zh-CN': '社交',
144+
'zh-Hant': '社交'
145+
},
146+
[ToolTypeEnum.scientific]: {
147+
en: 'scientific',
148+
'zh-CN': '科学',
149+
'zh-Hant': '科學'
150+
},
151+
[ToolTypeEnum.other]: {
152+
en: 'other',
153+
'zh-CN': '其他',
154+
'zh-Hant': '其他'
155+
}
156+
} as const;
157+
94158
export const VersionListItemSchema = z.object({
95159
value: z.string(),
96160
description: z.string().optional(),

sdk/client.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import createClient from '@/contract/client';
22
import type { SystemVarType } from '@tool/type/tool';
33
import type { StreamMessageType } from '@tool/type/tool';
4-
54
export default createClient;
5+
import { ToolTypeEnum, ToolTypeTranslations } from '@tool/type/tool';
66

77
export type { SystemVarType, StreamMessageType as StreamMessage };
8-
98
export { RunToolWithStream } from './runToolStream';
109
export { StreamDataAnswerTypeEnum } from '@tool/type/tool';
10+
11+
export { ToolTypeEnum, ToolTypeTranslations };

0 commit comments

Comments
 (0)