Skip to content

Commit 8c85414

Browse files
authored
Merge pull request #50 from chaitin/develop/jw
feat: 支持分析模型添加
2 parents 657e01e + 629507a commit 8c85414

File tree

7 files changed

+45
-9
lines changed

7 files changed

+45
-9
lines changed

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ require (
1010
github.com/cloudwego/eino v0.3.51
1111
github.com/cloudwego/eino-ext/components/model/deepseek v0.0.0-20250522060253-ddb617598b09
1212
github.com/cloudwego/eino-ext/components/model/gemini v0.1.2
13-
github.com/cloudwego/eino-ext/components/model/ollama v0.0.0-20250624023530-68a1e4282a8e
1413
github.com/cloudwego/eino-ext/components/model/openai v0.0.0-20250710065240-482d48888f25
1514
github.com/google/generative-ai-go v0.20.1
1615
github.com/google/uuid v1.6.0
1716
github.com/labstack/echo/v4 v4.13.4
18-
github.com/ollama/ollama v0.6.5
1917
github.com/yuin/goldmark v1.7.11
2018
google.golang.org/api v0.239.0
2119
google.golang.org/genai v1.13.0

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ github.com/cloudwego/eino-ext/components/model/deepseek v0.0.0-20250522060253-dd
3838
github.com/cloudwego/eino-ext/components/model/deepseek v0.0.0-20250522060253-ddb617598b09/go.mod h1:JMBM8HTVQo0YaCBA0hWsZME6lDKFmMCU8jScQrZHiUc=
3939
github.com/cloudwego/eino-ext/components/model/gemini v0.1.2 h1:bt9xftOQhP0Nuh1Po6ZNljSzBvv11Aw6hFLR7V1sLd8=
4040
github.com/cloudwego/eino-ext/components/model/gemini v0.1.2/go.mod h1:1tv89uZ9hR/4AyQ+9yxFWLn52GaJDKtPXdEY7WZdyZc=
41-
github.com/cloudwego/eino-ext/components/model/ollama v0.0.0-20250624023530-68a1e4282a8e h1:eJ5vCso7pS3mjvqG0bjJXA6kELCPTu1w5pINmUct13A=
42-
github.com/cloudwego/eino-ext/components/model/ollama v0.0.0-20250624023530-68a1e4282a8e/go.mod h1:BiBTDNJAD/tHDUEy4fqHW2YpBLgzb2jzQFM8S/vibLA=
4341
github.com/cloudwego/eino-ext/components/model/openai v0.0.0-20250710065240-482d48888f25 h1:VpyaCtZLktcYVC4vY0+D9e6TD35VAHteI+Zv6JUHFfQ=
4442
github.com/cloudwego/eino-ext/components/model/openai v0.0.0-20250710065240-482d48888f25/go.mod h1:2mFQQnlhJrNgbW6YX1MOUUfXkGSbTz9Ylx37fbR0xBo=
4543
github.com/cloudwego/eino-ext/libs/acl/openai v0.0.0-20250626133421-3c142631c961 h1:fGE3RFHaAsrLjA+2fkE0YMsPrkFI6pEKKZmbhD42L7E=
@@ -161,8 +159,6 @@ github.com/nicksnyder/go-i18n/v2 v2.6.0 h1:C/m2NNWNiTB6SK4Ao8df5EWm3JETSTIGNXBpM
161159
github.com/nicksnyder/go-i18n/v2 v2.6.0/go.mod h1:88sRqr0C6OPyJn0/KRNaEz1uWorjxIKP7rUUcvycecE=
162160
github.com/nikolalohinski/gonja v1.5.3 h1:GsA+EEaZDZPGJ8JtpeGN78jidhOlxeJROpqMT9fTj9c=
163161
github.com/nikolalohinski/gonja v1.5.3/go.mod h1:RmjwxNiXAEqcq1HeK5SSMmqFJvKOfTfXhkJv6YBtPa4=
164-
github.com/ollama/ollama v0.6.5 h1:vXKkVX57ql/1ZzMw4SVK866Qfd6pjwEcITVyEpF0QXQ=
165-
github.com/ollama/ollama v0.6.5/go.mod h1:pGgtoNyc9DdM6oZI6yMfI6jTk2Eh4c36c2GpfQCH7PY=
166162
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
167163
github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
168164
github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=

test/ui_example/src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ function App() {
111111
<MenuItem value={'embedding'}>向量模型</MenuItem>
112112
<MenuItem value={'audio'}>音频模型</MenuItem>
113113
<MenuItem value={'reranker'}>重排序模型</MenuItem>
114+
<MenuItem value={'analysis'}>分析模型</MenuItem>
114115
</Select>
115116
</FormControl>
116117
</Box>

ui/ModelModal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@yokowu/modelkit-ui",
3-
"version": "0.7.7",
3+
"version": "0.8.0",
44
"description": "A reusable AI model configuration modal component for React applications",
55
"private": false,
66
"type": "module",

ui/ModelModal/src/ModelModal.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const titleMap: Record<string, string> = {
3535
["embedding"]: '向量模型',
3636
["rerank"]: '重排序模型',
3737
["reranker"]: '重排序模型',
38+
["analysis"]: '分析模型',
3839
};
3940

4041
export const ModelModal: React.FC<ModelModalProps> = ({
@@ -413,6 +414,8 @@ export const ModelModal: React.FC<ModelModalProps> = ({
413414
case 'rerank':
414415
case 'reranker':
415416
return it.rerank;
417+
case 'analysis':
418+
return it.analysis;
416419
default:
417420
return it.label === 'BaiZhiCloud' || it.label === 'Other';
418421
}
@@ -771,8 +774,8 @@ export const ModelModal: React.FC<ModelModalProps> = ({
771774

772775
</>
773776
)}
774-
{/* 高级设置部分 - 在选择了模型或者是其它供应商时显示,但不包括embedding、rerank、reranker类型 */}
775-
{(modelUserList.length !== 0 || providerBrand === 'Other') && !['embedding', 'rerank', 'reranker'].includes(model_type) && (
777+
{/* 高级设置部分 - 在选择了模型或者是其它供应商时显示,但不包括embedding、rerank、reranker、analysis类型 */}
778+
{(modelUserList.length !== 0 || providerBrand === 'Other') && !['embedding', 'rerank', 'reranker', 'analysis'].includes(model_type) && (
776779
<Box sx={{ mt: 2 }}>
777780
<Accordion
778781
sx={{

ui/ModelModal/src/constants/providers.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
1313
code: true,
1414
embedding: true,
1515
rerank: true,
16+
analysis: true,
1617
modelDocumentUrl: 'https://model-square.app.baizhi.cloud/token',
1718
defaultBaseUrl: 'https://model-square.app.baizhi.cloud/v1',
1819
},
@@ -27,6 +28,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
2728
code: true,
2829
embedding: false,
2930
rerank: false,
31+
analysis: true,
3032
modelDocumentUrl: 'https://zhipuaishengchan.datasink.sensorsdata.cn/t/Tv',
3133
defaultBaseUrl: 'https://open.bigmodel.cn/api/paas/v4',
3234
},
@@ -41,6 +43,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
4143
code: true,
4244
embedding: false,
4345
rerank: false,
46+
analysis: true,
4447
modelDocumentUrl: 'https://platform.deepseek.com/api_keys',
4548
defaultBaseUrl: 'https://api.deepseek.com/v1',
4649
},
@@ -55,6 +58,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
5558
code: true,
5659
embedding: false,
5760
rerank: false,
61+
analysis: true,
5862
modelDocumentUrl: 'https://console.cloud.tencent.com/hunyuan/api-key',
5963
defaultBaseUrl: 'https://api.hunyuan.cloud.tencent.com/v1',
6064
},
@@ -69,6 +73,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
6973
code: true,
7074
embedding: false,
7175
rerank: false,
76+
analysis: true,
7277
modelDocumentUrl: 'https://bailian.console.aliyun.com/?tab=model#/api-key',
7378
defaultBaseUrl: 'https://dashscope.aliyuncs.com/compatible-mode/v1',
7479
},
@@ -83,6 +88,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
8388
code: true,
8489
embedding: false,
8590
rerank: false,
91+
analysis: true,
8692
modelDocumentUrl: 'https://console.volcengine.com/ark/region:ark+cn-beijing/apiKey',
8793
defaultBaseUrl: 'https://ark.cn-beijing.volces.com/api/v3',
8894
},
@@ -97,6 +103,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
97103
code: true,
98104
embedding: false,
99105
rerank: false,
106+
analysis: true,
100107
modelDocumentUrl: 'https://platform.openai.com/api-keys',
101108
defaultBaseUrl: 'https://api.openai.com/v1',
102109
},
@@ -111,6 +118,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
111118
code: true,
112119
embedding: false,
113120
rerank: false,
121+
analysis: true,
114122
modelDocumentUrl: 'https://github.com/ollama/ollama/tree/main/docs',
115123
defaultBaseUrl: 'http://172.17.0.1:11434/v1',
116124
},
@@ -125,6 +133,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
125133
code: true,
126134
embedding: false,
127135
rerank: false,
136+
analysis: true,
128137
modelDocumentUrl: 'https://cloud.siliconflow.cn/me/account/ak',
129138
defaultBaseUrl: 'https://api.siliconflow.cn/v1',
130139
},
@@ -139,6 +148,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
139148
code: true,
140149
embedding: false,
141150
rerank: false,
151+
analysis: true,
142152
modelDocumentUrl: 'https://platform.moonshot.cn/console/api-keys',
143153
defaultBaseUrl: 'https://api.moonshot.cn/v1',
144154
},
@@ -153,6 +163,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
153163
code: true,
154164
embedding: false,
155165
rerank: false,
166+
analysis: true,
156167
modelDocumentUrl: 'https://portal.azure.com/#view/Microsoft_Azure_ProjectOxford/CognitiveServicesHub/~/OpenAI',
157168
defaultBaseUrl: 'https://<resource_name>.openai.azure.com',
158169
},
@@ -167,6 +178,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
167178
code: true,
168179
embedding: false,
169180
rerank: false,
181+
analysis: true,
170182
modelDocumentUrl: 'https://aistudio.google.com/app/apikey',
171183
defaultBaseUrl: 'https://generativelanguage.googleapis.com',
172184
},
@@ -181,6 +193,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
181193
code: false,
182194
embedding: false,
183195
rerank: false,
196+
analysis: true,
184197
modelDocumentUrl: 'https://portal.qiniu.com/ai-inference/api-key',
185198
defaultBaseUrl: 'https://api.qnaigc.com/v1',
186199
},
@@ -235,6 +248,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
235248
code: false,
236249
embedding: false,
237250
rerank: false,
251+
analysis: true,
238252
modelDocumentUrl: 'https://platform.lingyiwanwu.com/apikeys',
239253
defaultBaseUrl: 'https://api.lingyiwanwu.com/v1',
240254
},
@@ -310,6 +324,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
310324
code: false,
311325
embedding: false,
312326
rerank: false,
327+
analysis: true,
313328
modelDocumentUrl: 'https://huiju.ctyun.cn/service/serviceGroup',
314329
defaultBaseUrl: 'https://wishub-x1.ctyun.cn/v1',
315330
},
@@ -324,6 +339,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
324339
code: false,
325340
embedding: false,
326341
rerank: false,
342+
analysis: true,
327343
modelDocumentUrl: 'https://console.cloud.tencent.com/lkeap/api',
328344
defaultBaseUrl: 'https://api.lkeap.cloud.tencent.com/v1',
329345
},
@@ -338,6 +354,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
338354
code: false,
339355
embedding: false,
340356
rerank: false,
357+
analysis: true,
341358
modelDocumentUrl: 'https://console.bce.baidu.com/iam/#/iam/apikey/list',
342359
defaultBaseUrl: 'https://qianfan.baidubce.com/v2',
343360
},
@@ -352,6 +369,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
352369
code: false,
353370
embedding: false,
354371
rerank: false,
372+
analysis: false,
355373
modelDocumentUrl: 'https://modelscope.cn/my/myaccesstoken',
356374
defaultBaseUrl: 'https://api-inference.modelscope.cn/v1',
357375
},
@@ -366,6 +384,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
366384
code: true,
367385
embedding: false,
368386
rerank: false,
387+
analysis: true,
369388
modelDocumentUrl: 'https://cloud.infini-ai.com/iam/secret/key',
370389
defaultBaseUrl: 'https://cloud.infini-ai.com/maas/v1',
371390
},
@@ -380,6 +399,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
380399
code: false,
381400
embedding: false,
382401
rerank: false,
402+
analysis: false,
383403
modelDocumentUrl: 'https://platform.stepfun.com/interface-key',
384404
defaultBaseUrl: 'https://api.stepfun.com/v1',
385405
},
@@ -394,6 +414,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
394414
code: false,
395415
embedding: false,
396416
rerank: false,
417+
analysis: false,
397418
modelDocumentUrl: 'https://maas.lanyun.net/#/system/apiKey',
398419
defaultBaseUrl: 'https://maas-api.lanyun.net/v1',
399420
},
@@ -408,6 +429,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
408429
code: false,
409430
embedding: false,
410431
rerank: false,
432+
analysis: false,
411433
modelDocumentUrl: ' https://www.alayanew.com/backend/register',
412434
defaultBaseUrl: 'https://deepseek.alayanew.com/v1',
413435
},
@@ -422,6 +444,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
422444
code: true,
423445
embedding: false,
424446
rerank: false,
447+
analysis: false,
425448
modelDocumentUrl: 'https://ppio.com/settings/key-management',
426449
defaultBaseUrl: 'https://api.ppinfra.com/v3/openai',
427450
},
@@ -436,6 +459,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
436459
code: false,
437460
embedding: false,
438461
rerank: false,
462+
analysis: false,
439463
modelDocumentUrl: 'https://aihubmix.com',
440464
defaultBaseUrl: 'https://aihubmix.com/v1',
441465
},
@@ -450,6 +474,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
450474
code: true,
451475
embedding: false,
452476
rerank: false,
477+
analysis: true,
453478
modelDocumentUrl: 'https://one.ocoolai.com/token',
454479
defaultBaseUrl: 'https://api.ocoolai.com/v1',
455480
},
@@ -464,6 +489,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
464489
code: false,
465490
embedding: false,
466491
rerank: false,
492+
analysis: false,
467493
modelDocumentUrl: 'https://www.dmxapi.cn/register',
468494
defaultBaseUrl: 'https://www.dmxapi.cn/v1',
469495
},
@@ -478,6 +504,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
478504
code: false,
479505
embedding: false,
480506
rerank: false,
507+
analysis: true,
481508
modelDocumentUrl: 'https://ai.burncloud.com/console/token',
482509
defaultBaseUrl: 'https://ai.burncloud.com/v1',
483510
},
@@ -502,6 +529,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
502529
code: false,
503530
embedding: false,
504531
rerank: false,
532+
analysis: true,
505533
modelDocumentUrl: 'https://build.nvidia.com/?integrate_nim=true&hosted_api=true&modal=integrate-nim',
506534
defaultBaseUrl: 'https://integrate.api.nvidia.com/v1',
507535
},
@@ -516,6 +544,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
516544
code: false,
517545
embedding: false,
518546
rerank: false,
547+
analysis: false,
519548
modelDocumentUrl: 'https://tokenflux.ai/docs',
520549
defaultBaseUrl: 'https://tokenflux.ai/v1',
521550
},
@@ -530,6 +559,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
530559
code: true,
531560
embedding: false,
532561
rerank: false,
562+
analysis: true,
533563
modelDocumentUrl: 'https://dash.302.ai/apis/list',
534564
defaultBaseUrl: 'https://api.302.ai/v1',
535565
},
@@ -544,6 +574,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
544574
code: false,
545575
embedding: false,
546576
rerank: false,
577+
analysis: false,
547578
modelDocumentUrl: 'https://cephalon.cloud/api',
548579
defaultBaseUrl: 'https://cephalon.cloud/user-center/v1/model',
549580
},
@@ -558,6 +589,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
558589
code: false,
559590
embedding: false,
560591
rerank: false,
592+
analysis: false,
561593
modelDocumentUrl: 'https://openrouter.ai/settings/keys',
562594
defaultBaseUrl: 'https://openrouter.ai/api/v1',
563595
},
@@ -572,6 +604,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
572604
code: true,
573605
embedding: false,
574606
rerank: false,
607+
analysis: true,
575608
modelDocumentUrl: 'https://app.fireworks.ai/settings/users/api-keys',
576609
defaultBaseUrl: 'https://api.fireworks.ai/inference/v1',
577610
},
@@ -586,6 +619,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
586619
code: false,
587620
embedding: false,
588621
rerank: false,
622+
analysis: false,
589623
modelDocumentUrl: 'https://console.mistral.ai/api-keys/',
590624
defaultBaseUrl: 'https://api.mistral.ai/v1',
591625
},
@@ -600,6 +634,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
600634
code: false,
601635
embedding: false,
602636
rerank: false,
637+
analysis: false,
603638
modelDocumentUrl: 'https://www.perplexity.ai/settings/api',
604639
defaultBaseUrl: 'https://api.perplexity.ai',
605640
},
@@ -614,6 +649,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
614649
code: false,
615650
embedding: false,
616651
rerank: false,
652+
analysis: false,
617653
modelDocumentUrl: 'https://app.hyperbolic.xyz/settings',
618654
defaultBaseUrl: 'https://api.hyperbolic.xyz/v1',
619655
},
@@ -648,6 +684,7 @@ export const DEFAULT_MODEL_PROVIDERS: ModelProviderMap = {
648684
code: true,
649685
embedding: true,
650686
rerank: true,
687+
analysis: true,
651688
modelDocumentUrl: '',
652689
defaultBaseUrl: '',
653690
},

ui/ModelModal/src/types/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export interface ModelProviderConfig {
5757
code: boolean;
5858
embedding: boolean;
5959
rerank: boolean;
60+
analysis: boolean;
6061
modelDocumentUrl?: string;
6162
defaultBaseUrl: string;
6263
}

0 commit comments

Comments
 (0)