Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ui/ModelModal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yokowu/modelkit-ui",
"version": "0.4.2",
"version": "0.5.0",
"description": "A reusable AI model configuration modal component for React applications",
"private": false,
"type": "module",
Expand Down Expand Up @@ -29,7 +29,8 @@
"type-check": "tsc --noEmit",
"lint": "eslint src --ext .ts,.tsx",
"clean": "rimraf dist",
"prepublishOnly": "npm run build"
"prepublishOnly": "npm run build",
"icon": "node ./scripts/downLoadIcon.cjs"
},
"keywords": [
"react",
Expand Down
23 changes: 23 additions & 0 deletions ui/ModelModal/scripts/downLoadIcon.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const fs = require("fs");
const path = require("path");

async function downloadFile(url) {
const iconPath = path.resolve(__dirname, "../src/assets/fonts/iconfont.js");
const iconDir = path.dirname(iconPath);

// 检查目录是否存在,不存在则创建
if (!fs.existsSync(iconDir)) {
fs.mkdirSync(iconDir, { recursive: true });
console.log(`目录 ${iconDir} 已创建`);
}

const response = await fetch(`https:${url}`, {
method: "GET",
// responseType: "stream", // fetch 不支持此参数
}).then((res) => res.text());
fs.writeFileSync(iconPath, response);
console.log("Download Icon Success");
}
let argument = process.argv.splice(2);
downloadFile(argument[0]);

2 changes: 1 addition & 1 deletion ui/ModelModal/src/assets/fonts/iconfont.js

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions ui/ModelModal/src/constants/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
Qiniu: {
label: 'Qiniu',
cn: '七牛云',
icon: 'icon-qiniu',
icon: 'icon-qiniuyun',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand Down Expand Up @@ -175,7 +175,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
Yi: {
label: 'Yi',
cn: '零一万物',
icon: 'icon-yi',
icon: 'icon-lingyiwanwu',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand Down Expand Up @@ -246,7 +246,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
CTYun: {
label: 'CTYun',
cn: '天翼云息壤',
icon: 'icon-ctyun',
icon: 'icon-tianyiyun',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand All @@ -256,7 +256,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
TencentTI: {
label: 'TencentTI',
cn: '腾讯云TI',
icon: 'icon-tencentcloud',
icon: 'icon-tengxunyun',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand All @@ -266,7 +266,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
BaiDuQianFan: {
label: 'BaiDuQianFan',
cn: '百度云千帆',
icon: 'icon-baiduqianfan',
icon: 'icon-baiduyun',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand All @@ -276,7 +276,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
ModelScope: {
label: 'ModelScope',
cn: '魔搭社区',
icon: 'icon-modelscope',
icon: 'icon-modaGPT',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand All @@ -296,7 +296,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
StepFun: {
label: 'StepFun',
cn: '阶跃星辰',
icon: 'icon-stepfun',
icon: 'icon-step',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand Down Expand Up @@ -356,7 +356,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
DMXAPI: {
label: 'DMXAPI',
cn: 'DMXAPI',
icon: 'icon-dmxapi',
icon: 'icon-DMXAPI',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand All @@ -373,20 +373,20 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
modelDocumentUrl: 'https://ai.burncloud.com/docs',
defaultBaseUrl: 'https://ai.burncloud.com/v1',
},
Grok: {
label: 'Grok',
cn: 'Grok',
icon: 'icon-grok',
urlWrite: false,
secretRequired: true,
customHeader: false,
modelDocumentUrl: 'https://docs.x.ai/',
defaultBaseUrl: 'https://api.x.ai/v1',
},
// Grok: {
// label: 'Grok',
// cn: 'Grok',
// icon: 'icon-grok',
// urlWrite: false,
// secretRequired: true,
// customHeader: false,
// modelDocumentUrl: 'https://docs.x.ai/',
// defaultBaseUrl: 'https://api.x.ai/v1',
// },
Nvidia: {
label: 'Nvidia',
cn: '英伟达',
icon: 'icon-nvidia',
icon: 'icon-yingweida',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand All @@ -406,7 +406,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
AI302: {
label: 'AI302',
cn: '302.AI',
icon: 'icon-302ai',
icon: 'icon-a-302ai',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand Down Expand Up @@ -446,7 +446,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
Mistral: {
label: 'Mistral',
cn: 'Mistral',
icon: 'icon-mistral',
icon: 'icon-Mistral',
urlWrite: false,
secretRequired: true,
customHeader: false,
Expand Down
Loading