diff --git a/web/app/components/base/icons/assets/image/llm/baichuan-text-cn.png b/web/app/components/base/icons/assets/image/llm/baichuan-text-cn.png new file mode 100644 index 0000000000..9346b6990d Binary files /dev/null and b/web/app/components/base/icons/assets/image/llm/baichuan-text-cn.png differ diff --git a/web/app/components/base/icons/assets/public/llm/baichuan-text.svg b/web/app/components/base/icons/assets/public/llm/baichuan-text.svg new file mode 100644 index 0000000000..7ff6b5a67a --- /dev/null +++ b/web/app/components/base/icons/assets/public/llm/baichuan-text.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/web/app/components/base/icons/assets/public/llm/baichuan.svg b/web/app/components/base/icons/assets/public/llm/baichuan.svg new file mode 100644 index 0000000000..4ddcd26726 --- /dev/null +++ b/web/app/components/base/icons/assets/public/llm/baichuan.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/web/app/components/base/icons/script.js b/web/app/components/base/icons/script.js index 93ceb0a184..f892c45ff3 100644 --- a/web/app/components/base/icons/script.js +++ b/web/app/components/base/icons/script.js @@ -115,6 +115,8 @@ const Icon = React.forwardRef ) +Icon.displayName = '<%= fileName %>' + export default Icon `.trim()) diff --git a/web/app/components/base/icons/src/image/llm/BaichuanTextCn.module.css b/web/app/components/base/icons/src/image/llm/BaichuanTextCn.module.css new file mode 100644 index 0000000000..97ab9b22f9 --- /dev/null +++ b/web/app/components/base/icons/src/image/llm/BaichuanTextCn.module.css @@ -0,0 +1,5 @@ +.wrapper { + display: inline-flex; + background: url(~@/app/components/base/icons/assets/image/llm/baichuan-text-cn.png) center center no-repeat; + background-size: contain; +} diff --git a/web/app/components/base/icons/src/image/llm/BaichuanTextCn.tsx b/web/app/components/base/icons/src/image/llm/BaichuanTextCn.tsx new file mode 100644 index 0000000000..5ae8f57d65 --- /dev/null +++ b/web/app/components/base/icons/src/image/llm/BaichuanTextCn.tsx @@ -0,0 +1,15 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import cn from 'classnames' +import s from './BaichuanTextCn.module.css' + +const Icon = React.forwardRef, HTMLSpanElement>>(( + { className, ...restProps }, + ref, +) => ) + +Icon.displayName = 'BaichuanTextCn' + +export default Icon diff --git a/web/app/components/base/icons/src/image/llm/Minimax.tsx b/web/app/components/base/icons/src/image/llm/Minimax.tsx index e3e84fe1ac..de07044dd0 100644 --- a/web/app/components/base/icons/src/image/llm/Minimax.tsx +++ b/web/app/components/base/icons/src/image/llm/Minimax.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'Minimax' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/MinimaxText.tsx b/web/app/components/base/icons/src/image/llm/MinimaxText.tsx index 92413976ae..747c9ed7ea 100644 --- a/web/app/components/base/icons/src/image/llm/MinimaxText.tsx +++ b/web/app/components/base/icons/src/image/llm/MinimaxText.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'MinimaxText' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/Tongyi.tsx b/web/app/components/base/icons/src/image/llm/Tongyi.tsx index 1de1851bc8..98d85ff0b5 100644 --- a/web/app/components/base/icons/src/image/llm/Tongyi.tsx +++ b/web/app/components/base/icons/src/image/llm/Tongyi.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'Tongyi' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/TongyiText.tsx b/web/app/components/base/icons/src/image/llm/TongyiText.tsx index fa30b7eceb..1aaffab437 100644 --- a/web/app/components/base/icons/src/image/llm/TongyiText.tsx +++ b/web/app/components/base/icons/src/image/llm/TongyiText.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'TongyiText' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/TongyiTextCn.tsx b/web/app/components/base/icons/src/image/llm/TongyiTextCn.tsx index eb841f15b2..225c5df46e 100644 --- a/web/app/components/base/icons/src/image/llm/TongyiTextCn.tsx +++ b/web/app/components/base/icons/src/image/llm/TongyiTextCn.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'TongyiTextCn' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/Wxyy.tsx b/web/app/components/base/icons/src/image/llm/Wxyy.tsx index 4a358b64a5..070c8967fe 100644 --- a/web/app/components/base/icons/src/image/llm/Wxyy.tsx +++ b/web/app/components/base/icons/src/image/llm/Wxyy.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'Wxyy' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/WxyyText.tsx b/web/app/components/base/icons/src/image/llm/WxyyText.tsx index 3f83b326a6..07a9f98d2a 100644 --- a/web/app/components/base/icons/src/image/llm/WxyyText.tsx +++ b/web/app/components/base/icons/src/image/llm/WxyyText.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'WxyyText' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/WxyyTextCn.tsx b/web/app/components/base/icons/src/image/llm/WxyyTextCn.tsx index b81998e469..7938dd3288 100644 --- a/web/app/components/base/icons/src/image/llm/WxyyTextCn.tsx +++ b/web/app/components/base/icons/src/image/llm/WxyyTextCn.tsx @@ -10,4 +10,6 @@ const Icon = React.forwardRef ) +Icon.displayName = 'WxyyTextCn' + export default Icon diff --git a/web/app/components/base/icons/src/image/llm/index.ts b/web/app/components/base/icons/src/image/llm/index.ts index 856d4316e7..3a4e64ac18 100644 --- a/web/app/components/base/icons/src/image/llm/index.ts +++ b/web/app/components/base/icons/src/image/llm/index.ts @@ -1,3 +1,4 @@ +export { default as BaichuanTextCn } from './BaichuanTextCn' export { default as MinimaxText } from './MinimaxText' export { default as Minimax } from './Minimax' export { default as TongyiTextCn } from './TongyiTextCn' diff --git a/web/app/components/base/icons/src/public/llm/Baichuan.json b/web/app/components/base/icons/src/public/llm/Baichuan.json new file mode 100644 index 0000000000..ad93703002 --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/Baichuan.json @@ -0,0 +1,76 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "24", + "height": "24", + "viewBox": "0 0 24 24", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "g", + "attributes": { + "id": "Baichuan" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "id": "Union", + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M8.58154 1.7793H5.52779L3.34655 6.20409V17.7335L0.916016 22.2206H6.21333L8.58154 17.7335V1.7793ZM10.5761 1.7793H15.8111V22.2206H10.5761V1.7793ZM22.9166 1.7793H17.6816V6.01712H22.9166V1.7793ZM22.9166 7.38818H17.6816V22.2206H22.9166V7.38818Z", + "fill": "url(#paint0_radial_11622_96084)" + }, + "children": [] + } + ] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "radialGradient", + "attributes": { + "id": "paint0_radial_11622_96084", + "cx": "0", + "cy": "0", + "r": "1", + "gradientUnits": "userSpaceOnUse", + "gradientTransform": "translate(5.5 5.5) rotate(45) scale(20.5061 22.0704)" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "#FEBD3F" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "0.77608", + "stop-color": "#FF6933" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "Baichuan" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/llm/Baichuan.tsx b/web/app/components/base/icons/src/public/llm/Baichuan.tsx new file mode 100644 index 0000000000..e62e0a0af6 --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/Baichuan.tsx @@ -0,0 +1,16 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './Baichuan.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase' + +const Icon = React.forwardRef, Omit>(( + props, + ref, +) => ) + +Icon.displayName = 'Baichuan' + +export default Icon diff --git a/web/app/components/base/icons/src/public/llm/BaichuanText.json b/web/app/components/base/icons/src/public/llm/BaichuanText.json new file mode 100644 index 0000000000..cda52e97fd --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/BaichuanText.json @@ -0,0 +1,156 @@ +{ + "icon": { + "type": "element", + "isRootNode": true, + "name": "svg", + "attributes": { + "width": "130", + "height": "24", + "viewBox": "0 0 130 24", + "fill": "none", + "xmlns": "http://www.w3.org/2000/svg" + }, + "children": [ + { + "type": "element", + "name": "path", + "attributes": { + "fill-rule": "evenodd", + "clip-rule": "evenodd", + "d": "M9.58154 1.7793H6.52779L4.34655 6.20409V17.7335L1.91602 22.2206H7.21333L9.58154 17.7335V1.7793ZM11.5761 1.7793H16.8111V22.2206H11.5761V1.7793ZM23.9166 1.7793H18.6816V6.01712H23.9166V1.7793ZM23.9166 7.38818H18.6816V22.2206H23.9166V7.38818Z", + "fill": "url(#paint0_radial_11622_96091)" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M129.722 6.83203V18H127.482V6.83203H129.722Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M123.196 15.872H118.748L118.012 18H115.66L119.676 6.81604H122.284L126.3 18H123.932L123.196 15.872ZM122.588 14.08L120.972 9.40804L119.356 14.08H122.588Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M110.962 18H108.722L103.65 10.336V18H101.41V6.81598H103.65L108.722 14.496V6.81598H110.962V18Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M97.1258 15.872H92.6778L91.9418 18H89.5898L93.6058 6.81604H96.2138L100.23 18H97.8618L97.1258 15.872ZM96.5178 14.08L94.9018 9.40804L93.2858 14.08H96.5178Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M81.6482 6.83203V13.744C81.6482 14.5014 81.8455 15.0827 82.2402 15.488C82.6349 15.8827 83.1895 16.08 83.9042 16.08C84.6295 16.08 85.1895 15.8827 85.5842 15.488C85.9789 15.0827 86.1762 14.5014 86.1762 13.744V6.83203H88.4322V13.728C88.4322 14.6774 88.2242 15.4827 87.8082 16.144C87.4029 16.7947 86.8535 17.2854 86.1602 17.616C85.4775 17.9467 84.7149 18.112 83.8722 18.112C83.0402 18.112 82.2829 17.9467 81.6002 17.616C80.9282 17.2854 80.3949 16.7947 80.0002 16.144C79.6055 15.4827 79.4082 14.6774 79.4082 13.728V6.83203H81.6482Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M77.557 6.83203V18H75.317V13.248H70.533V18H68.293V6.83203H70.533V11.424H75.317V6.83203H77.557Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M55.7871 12.4C55.7871 11.3013 56.0324 10.32 56.5231 9.45599C57.0244 8.58132 57.7018 7.90399 58.5551 7.42399C59.4191 6.93332 60.3844 6.68799 61.4511 6.68799C62.6991 6.68799 63.7924 7.00799 64.7311 7.64799C65.6698 8.28799 66.3258 9.17332 66.6991 10.304H64.1231C63.8671 9.77065 63.5044 9.37065 63.0351 9.10399C62.5764 8.83732 62.0431 8.70399 61.4351 8.70399C60.7844 8.70399 60.2031 8.85865 59.6911 9.16799C59.1898 9.46665 58.7951 9.89332 58.5071 10.448C58.2298 11.0027 58.0911 11.6533 58.0911 12.4C58.0911 13.136 58.2298 13.7867 58.5071 14.352C58.7951 14.9067 59.1898 15.3387 59.6911 15.648C60.2031 15.9467 60.7844 16.096 61.4351 16.096C62.0431 16.096 62.5764 15.9627 63.0351 15.696C63.5044 15.4187 63.8671 15.0133 64.1231 14.48H66.6991C66.3258 15.6213 65.6698 16.512 64.7311 17.152C63.8031 17.7813 62.7098 18.096 61.4511 18.096C60.3844 18.096 59.4191 17.856 58.5551 17.376C57.7018 16.8853 57.0244 16.208 56.5231 15.344C56.0324 14.48 55.7871 13.4987 55.7871 12.4Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M54.4373 6.83203V18H52.1973V6.83203H54.4373Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M47.913 15.872H43.465L42.729 18H40.377L44.393 6.81598H47.001L51.017 18H48.649L47.913 15.872ZM47.305 14.08L45.689 9.40798L44.073 14.08H47.305Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "path", + "attributes": { + "d": "M37.4395 12.272C38.0688 12.3893 38.5862 12.704 38.9915 13.216C39.3968 13.728 39.5995 14.3146 39.5995 14.976C39.5995 15.5733 39.4502 16.1013 39.1515 16.56C38.8635 17.008 38.4422 17.36 37.8875 17.616C37.3328 17.872 36.6768 18 35.9195 18H31.1035V6.83197H35.7115C36.4688 6.83197 37.1195 6.95464 37.6635 7.19997C38.2182 7.4453 38.6342 7.78664 38.9115 8.22397C39.1995 8.6613 39.3435 9.1573 39.3435 9.71197C39.3435 10.3626 39.1675 10.9066 38.8155 11.344C38.4742 11.7813 38.0155 12.0906 37.4395 12.272ZM33.3435 11.44H35.3915C35.9248 11.44 36.3355 11.3226 36.6235 11.088C36.9115 10.8426 37.0555 10.496 37.0555 10.048C37.0555 9.59997 36.9115 9.2533 36.6235 9.00797C36.3355 8.76264 35.9248 8.63997 35.3915 8.63997H33.3435V11.44ZM35.5995 16.176C36.1435 16.176 36.5648 16.048 36.8635 15.792C37.1728 15.536 37.3275 15.1733 37.3275 14.704C37.3275 14.224 37.1675 13.8506 36.8475 13.584C36.5275 13.3066 36.0955 13.168 35.5515 13.168H33.3435V16.176H35.5995Z", + "fill": "#FF6A34" + }, + "children": [] + }, + { + "type": "element", + "name": "defs", + "attributes": {}, + "children": [ + { + "type": "element", + "name": "radialGradient", + "attributes": { + "id": "paint0_radial_11622_96091", + "cx": "0", + "cy": "0", + "r": "1", + "gradientUnits": "userSpaceOnUse", + "gradientTransform": "translate(6.5 5.5) rotate(45) scale(20.5061 22.0704)" + }, + "children": [ + { + "type": "element", + "name": "stop", + "attributes": { + "stop-color": "#FEBD3F" + }, + "children": [] + }, + { + "type": "element", + "name": "stop", + "attributes": { + "offset": "0.77608", + "stop-color": "#FF6933" + }, + "children": [] + } + ] + } + ] + } + ] + }, + "name": "BaichuanText" +} \ No newline at end of file diff --git a/web/app/components/base/icons/src/public/llm/BaichuanText.tsx b/web/app/components/base/icons/src/public/llm/BaichuanText.tsx new file mode 100644 index 0000000000..3e2483740d --- /dev/null +++ b/web/app/components/base/icons/src/public/llm/BaichuanText.tsx @@ -0,0 +1,16 @@ +// GENERATE BY script +// DON NOT EDIT IT MANUALLY + +import * as React from 'react' +import data from './BaichuanText.json' +import IconBase from '@/app/components/base/icons/IconBase' +import type { IconBaseProps, IconData } from '@/app/components/base/icons/IconBase' + +const Icon = React.forwardRef, Omit>(( + props, + ref, +) => ) + +Icon.displayName = 'BaichuanText' + +export default Icon diff --git a/web/app/components/base/icons/src/public/llm/index.ts b/web/app/components/base/icons/src/public/llm/index.ts index ed8872dd47..9144e6fa05 100644 --- a/web/app/components/base/icons/src/public/llm/index.ts +++ b/web/app/components/base/icons/src/public/llm/index.ts @@ -4,6 +4,8 @@ export { default as AzureOpenaiServiceText } from './AzureOpenaiServiceText' export { default as AzureOpenaiService } from './AzureOpenaiService' export { default as AzureaiText } from './AzureaiText' export { default as Azureai } from './Azureai' +export { default as BaichuanText } from './BaichuanText' +export { default as Baichuan } from './Baichuan' export { default as ChatglmText } from './ChatglmText' export { default as Chatglm } from './Chatglm' export { default as Gpt3 } from './Gpt3' diff --git a/web/app/components/header/account-setting/model-page/configs/baichuan.tsx b/web/app/components/header/account-setting/model-page/configs/baichuan.tsx new file mode 100644 index 0000000000..10a8415b24 --- /dev/null +++ b/web/app/components/header/account-setting/model-page/configs/baichuan.tsx @@ -0,0 +1,70 @@ +import { ProviderEnum } from '../declarations' +import type { ProviderConfig } from '../declarations' +import { BaichuanTextCn } from '@/app/components/base/icons/src/image/llm' +import { + Baichuan, + BaichuanText, +} from '@/app/components/base/icons/src/public/llm' + +const config: ProviderConfig = { + selector: { + name: { + 'en': 'BAICHUAN AI', + 'zh-Hans': '百川智能', + }, + icon: , + }, + item: { + key: ProviderEnum.baichuan, + titleIcon: { + 'en': , + 'zh-Hans': , + }, + }, + modal: { + key: ProviderEnum.baichuan, + title: { + 'en': 'BAICHUAN AI', + 'zh-Hans': '百川智能', + }, + icon: , + link: { + href: 'https://platform.baichuan-ai.com/console/apikey', + label: { + 'en': 'Get your API key from BAICHUAN AI', + 'zh-Hans': '从百川智能获取 API Key', + }, + }, + validateKeys: ['api_key', 'secret_key'], + fields: [ + { + type: 'text', + key: 'api_key', + required: true, + label: { + 'en': 'API Key', + 'zh-Hans': 'API Key', + }, + placeholder: { + 'en': 'Enter your API key here', + 'zh-Hans': '在此输入您的 API Key', + }, + }, + { + type: 'text', + key: 'secret_key', + required: true, + label: { + 'en': 'Secret Key', + 'zh-Hans': 'Secret Key', + }, + placeholder: { + 'en': 'Enter your Secret key here', + 'zh-Hans': '在此输入您的 Secret Key', + }, + }, + ], + }, +} + +export default config diff --git a/web/app/components/header/account-setting/model-page/configs/index.ts b/web/app/components/header/account-setting/model-page/configs/index.ts index 7fc0440507..ef36eff030 100644 --- a/web/app/components/header/account-setting/model-page/configs/index.ts +++ b/web/app/components/header/account-setting/model-page/configs/index.ts @@ -12,6 +12,7 @@ import xinference from './xinference' import openllm from './openllm' import localai from './localai' import zhipuai from './zhipuai' +import baichuan from './baichuan' export default { openai, @@ -28,4 +29,5 @@ export default { openllm, localai, zhipuai, + baichuan, } diff --git a/web/app/components/header/account-setting/model-page/configs/openllm.tsx b/web/app/components/header/account-setting/model-page/configs/openllm.tsx index 98b6cb0d7c..eaff496513 100644 --- a/web/app/components/header/account-setting/model-page/configs/openllm.tsx +++ b/web/app/components/header/account-setting/model-page/configs/openllm.tsx @@ -56,6 +56,31 @@ const config: ProviderConfig = { 'server_url', ], fields: [ + { + type: 'radio', + key: 'model_type', + required: true, + label: { + 'en': 'Model Type', + 'zh-Hans': '模型类型', + }, + options: [ + { + key: 'text-generation', + label: { + 'en': 'Text Generation', + 'zh-Hans': '文本生成', + }, + }, + { + key: 'embeddings', + label: { + 'en': 'Embeddings', + 'zh-Hans': 'Embeddings', + }, + }, + ], + }, { type: 'text', key: 'model_name', diff --git a/web/app/components/header/account-setting/model-page/declarations.ts b/web/app/components/header/account-setting/model-page/declarations.ts index b0c4b4d9b8..47446e885e 100644 --- a/web/app/components/header/account-setting/model-page/declarations.ts +++ b/web/app/components/header/account-setting/model-page/declarations.ts @@ -43,6 +43,7 @@ export enum ProviderEnum { 'openllm' = 'openllm', 'localai' = 'localai', 'zhipuai' = 'zhipuai', + 'baichuan' = 'baichuan', } export type ProviderConfigItem = { diff --git a/web/app/components/header/account-setting/model-page/index.tsx b/web/app/components/header/account-setting/model-page/index.tsx index 3c4986df95..0b3666dc2d 100644 --- a/web/app/components/header/account-setting/model-page/index.tsx +++ b/web/app/components/header/account-setting/model-page/index.tsx @@ -79,6 +79,7 @@ const ModelPage = () => { config.replicate, config.huggingface_hub, config.zhipuai, + config.baichuan, config.spark, config.minimax, config.tongyi, @@ -93,6 +94,7 @@ const ModelPage = () => { modelList = [ config.huggingface_hub, config.zhipuai, + config.baichuan, config.spark, config.minimax, config.azure_openai,