From df07fb595169dd57ae4cca9ce67febfcad00abe3 Mon Sep 17 00:00:00 2001 From: zxhlyh Date: Tue, 10 Oct 2023 12:10:43 +0800 Subject: [PATCH] feat: provider add baichuan (#1298) --- .../assets/image/llm/baichuan-text-cn.png | Bin 0 -> 4652 bytes .../icons/assets/public/llm/baichuan-text.svg | 19 +++ .../base/icons/assets/public/llm/baichuan.svg | 11 ++ web/app/components/base/icons/script.js | 2 + .../src/image/llm/BaichuanTextCn.module.css | 5 + .../icons/src/image/llm/BaichuanTextCn.tsx | 15 ++ .../base/icons/src/image/llm/Minimax.tsx | 2 + .../base/icons/src/image/llm/MinimaxText.tsx | 2 + .../base/icons/src/image/llm/Tongyi.tsx | 2 + .../base/icons/src/image/llm/TongyiText.tsx | 2 + .../base/icons/src/image/llm/TongyiTextCn.tsx | 2 + .../base/icons/src/image/llm/Wxyy.tsx | 2 + .../base/icons/src/image/llm/WxyyText.tsx | 2 + .../base/icons/src/image/llm/WxyyTextCn.tsx | 2 + .../base/icons/src/image/llm/index.ts | 1 + .../base/icons/src/public/llm/Baichuan.json | 76 +++++++++ .../base/icons/src/public/llm/Baichuan.tsx | 16 ++ .../icons/src/public/llm/BaichuanText.json | 156 ++++++++++++++++++ .../icons/src/public/llm/BaichuanText.tsx | 16 ++ .../base/icons/src/public/llm/index.ts | 2 + .../model-page/configs/baichuan.tsx | 70 ++++++++ .../model-page/configs/index.ts | 2 + .../model-page/configs/openllm.tsx | 25 +++ .../model-page/declarations.ts | 1 + .../account-setting/model-page/index.tsx | 2 + 25 files changed, 435 insertions(+) create mode 100644 web/app/components/base/icons/assets/image/llm/baichuan-text-cn.png create mode 100644 web/app/components/base/icons/assets/public/llm/baichuan-text.svg create mode 100644 web/app/components/base/icons/assets/public/llm/baichuan.svg create mode 100644 web/app/components/base/icons/src/image/llm/BaichuanTextCn.module.css create mode 100644 web/app/components/base/icons/src/image/llm/BaichuanTextCn.tsx create mode 100644 web/app/components/base/icons/src/public/llm/Baichuan.json create mode 100644 web/app/components/base/icons/src/public/llm/Baichuan.tsx create mode 100644 web/app/components/base/icons/src/public/llm/BaichuanText.json create mode 100644 web/app/components/base/icons/src/public/llm/BaichuanText.tsx create mode 100644 web/app/components/header/account-setting/model-page/configs/baichuan.tsx 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 0000000000000000000000000000000000000000..9346b6990d6be99a298c94fabd20c6bbaa33d158 GIT binary patch literal 4652 zcmV+{64UL8P)KQUL1VgJh7IKP)`~#w;C_^@qm}B0800}K1S8*vI0YyL{C0&9b&<=SE0+{5% zD*{HSU0oemE5Ny0LtkuIq`f{H@D2?KFv$Z~CS|R-)303hs$Tz|*`A%9U2@$8ENA+4 z_v@bS@74S2tLi2|V~sV|SYwSf*4R^T2s<$P;omPhm)Y0pU-YoJLUa7T-?|t% zd=_L|2V|e%h7Kb6l>LUhAK@DQ=g(G?{{QR5X>j-=#1Z<9V%b-AhdrblU==GNB$38ZHoTC%|3WZxKcs5)5Ze;dFzR@)+&(5Myl7^L8V$9t0jk|He4 z7J^X5DGA6uKoLCXrOmHLMe&HULNKWN?e#chYqWdZ*$ma#pRY{>_~D2Duz)S>K#OtK z(!H_8xRvFoj6L+dqd*lf0X`<+*R|EhqGG#WrtCrk_Qoc*i2xt9aFIO7mBu6^<@BN@tY6qj>g+ zgt}11V<)CmCZJZFw0GP}?L8q+*nQz(fzTwp2X%~O+8Q^1;EZ}bpo{Z!Fhi^5;l;Z% zx;pBO%_|EAMP?Lk?txt8d(EZ$J;F3VXs+9QHt+355qVN&hC**fhf*?hU_ej3F2L_M zJ9z!)1DL`DG_bKc2b)Lc>h?wFyR3LUJj?g?1~0DhRs9&>yY)8gq3Q2mJql6#w{-r* zGPw8>USAuOxBFLsPY1`LP2U4i1Q8#=;jOpv>e@z~O7z6V24CBzDBDj=VAVJ{RZlKAnHL>z5UD zr(jas=mR`%UxaA5$bD%~u6=AQ_*-9y6M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xw=0yJx4JCRzCU))R;xT4ww+XChHA-^Fg)bH*UYrq2`Pn7>RHH~ zKI*$=%CFl{-mcQ61)@QcwECMsa|-(vIC{vi+ES+X85&-pH%?5>#V0;Y$-6JteL{b> zcBnteJ90E=S|DPCOTGy_R`ROd-G6SHPv~ZB>@pQ^Ca_2$Wm}o5E=|8@) zz$2#vRi)^mR?M1w4Mx#ofTaA_g?MDnxegz7^X09airGP{0K!sGsw70F6o@phbO!+|e2VrjgEN#X*JYN6h zGJE;H=kP*n9KODtceiqY{@9L18g_2LT5{Nq{3CLcnaseal1J?7nPfcWVU8DJGNZz$ z|DDXqZ^Cf6u1-OU#BdF0__|-e^a;`V?svfbVS#_=KSMdYyP;WPx5kO559+;nENWli z#L)|uQ?)ZeNZ*`F=H+o6+O12KeW)6f0zH)W=Ch`CUbm5#fMx}D*FKtjpByBK;nJ;I z=Vt(4VBq(5i^||qUp|)Yub!nIH5f_a3$Na)eGN1#y73kRrvr+RvBhtqiLLkMS>v-xMF2g8`2{ILqX?vO}&Ah%ZWAeJO^ibstYf@_P^aibs?T?iJ@704? z{s+APC&L?s<>ZwGB@ftT)Mq7w)f!O17PzBrO*#m?1y8PDf3Kg4F>qimnl+~nRZWBp^XGH{i*TZiI+h%(Wwe+p`LkHIz8SYwSf i)>vbWHP+Y@YJUO)(M@A2 + + + + + + + + + + + + + + + + + + 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 000000000..4ddcd2672 --- /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 93ceb0a18..f892c45ff 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 000000000..97ab9b22f --- /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 000000000..5ae8f57d6 --- /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 e3e84fe1a..de07044dd 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 92413976a..747c9ed7e 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 1de1851bc..98d85ff0b 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 fa30b7ece..1aaffab43 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 eb841f15b..225c5df46 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 4a358b64a..070c8967f 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 3f83b326a..07a9f98d2 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 b81998e46..7938dd328 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 856d4316e..3a4e64ac1 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 000000000..ad9370300 --- /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 000000000..e62e0a0af --- /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 000000000..cda52e97f --- /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 000000000..3e2483740 --- /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 ed8872dd4..9144e6fa0 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 000000000..10a8415b2 --- /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 7fc044050..ef36eff03 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 98b6cb0d7..eaff49651 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 b0c4b4d9b..47446e885 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 3c4986df9..0b3666dc2 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,