Compare commits

..

126 Commits

Author SHA1 Message Date
Liujian 8083090414 update tongyi,bedrock define 2025-03-27 17:15:03 +08:00
Liujian 77d0d9bfb8 update issue template: APINTO Dashboard -> ApiPark 2025-03-19 16:23:23 +08:00
Liujian e434c7867f update tongyi define 2025-03-19 15:32:36 +08:00
Liujian 2574b2814b update ai api schema 2025-03-14 19:16:31 +08:00
Liujian 1564bd977e Fix the issue of duplicate custom suppliers and built-in suppliers 2025-03-14 19:13:58 +08:00
Liujian da85269c9f Add supplier differentiation, custom or built-in 2025-03-14 18:02:28 +08:00
Liujian 15f803a511 fix bug 2025-03-14 15:51:33 +08:00
Liujian 414308802c Fix the issue of local model data synchronization errors 2025-03-13 22:14:58 +08:00
Liujian 7333e4fda3 fix bug 2025-03-13 17:51:27 +08:00
Liujian 1cdaa29764 fix bug 2025-03-13 14:47:36 +08:00
Liujian 9d270b7b0e Merge remote-tracking branch 'origin/main' into feature/1.6-liujian
# Conflicts:
#	.gitlab-ci.yml
2025-03-13 14:19:57 +08:00
Liujian fdd1cd32a8 Merge remote-tracking branch 'github-pro/main' into feature/1.6-liujian 2025-03-13 14:16:37 +08:00
Liujian 6210a06d43 fix local model bug 2025-03-13 14:16:03 +08:00
ningyv 807132014a Merge pull request #255 from APIParkLab/feature/1.6-cx
feat: feature/1.6-Integrate custom model
2025-03-13 13:54:59 +08:00
lichunxian 041817cc3c Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!270
2025-03-13 13:54:52 +08:00
ningyv acb0ceb9a9 feat: feature/1.6-Integrate custom model 2025-03-13 13:46:32 +08:00
ningyv 417dab7ddc Merge pull request #254 from APIParkLab/feature/1.6-cx
Feature/1.6 cx
2025-03-13 12:01:10 +08:00
lichunxian 3a9a07c109 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!269
2025-03-13 12:00:17 +08:00
ningyv a02d505e2e feat: feature/1.6-Integrate custom model 2025-03-13 11:58:28 +08:00
孙安智 a0266b061f Merge branch 'feature/sunanzhi/1.6' into 'main'
Feature/sunanzhi/1.6

See merge request apipark/APIPark!268
2025-03-12 20:25:24 +08:00
刘健 f22738ec2b Merge branch 'feature/1.6-liujian' into 'main'
Feature/1.6 liujian

See merge request apipark/APIPark!267
2025-03-12 18:34:34 +08:00
孙安智 fed8e62965 Merge branch 'feature/sunanzhi/1.6' into 'main'
refactor: adjust vertex model ID

See merge request apipark/APIPark!266
2025-03-12 17:28:56 +08:00
lichunxian ced2143a6e Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!265
2025-03-12 15:43:30 +08:00
ningyv a58e2c4e67 feat: feature/1.6-Integrate custom model 2025-03-12 15:42:07 +08:00
孙安智 64c59e4886 Merge branch 'feature/sunanzhi/1.6' into 'main'
Feature/sunanzhi/1.6

See merge request apipark/APIPark!264
2025-03-12 14:54:37 +08:00
lichunxian 49f353033c Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!263
2025-03-12 14:09:50 +08:00
孙安智 eb7b9acb26 Merge branch 'feature/sunanzhi/1.6' into 'main'
Feature/sunanzhi/1.6

See merge request apipark/APIPark!262
2025-03-12 14:04:08 +08:00
刘健 093c698cf0 Merge branch 'feature/1.6-liujian' into 'main'
Feature/1.6 liujian

See merge request apipark/APIPark!261
2025-03-12 10:56:45 +08:00
孙安智 977665fac7 Merge branch 'feature/sunanzhi/1.6' into 'main'
Feature/sunanzhi/1.6

See merge request apipark/APIPark!260
2025-03-11 20:36:38 +08:00
lichunxian a153bfef02 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!259
2025-03-11 16:02:40 +08:00
孙安智 ccca43f3dc Merge branch 'feature/sunanzhi/1.6' into 'main'
refactor: remove validation for checking provider existence in model addition

See merge request apipark/APIPark!258
2025-03-11 15:23:28 +08:00
孙安智 bde2cca414 Merge branch 'feature/sunanzhi/1.6' into 'main'
Feature/sunanzhi/1.6

See merge request apipark/APIPark!257
2025-03-11 12:02:23 +08:00
lichunxian d29d198c88 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!256
2025-03-11 10:24:02 +08:00
刘健 cfafd043e9 Merge branch 'feature/1.6-liujian' into 'main'
Feature/1.6 liujian

See merge request apipark/APIPark!255
2025-03-11 10:04:59 +08:00
lichunxian 4723114bf5 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!254
2025-03-10 18:03:46 +08:00
孙安智 11e74fd08e Merge branch 'feature/sunanzhi/1.6' into 'main'
Feature/sunanzhi/1.6

See merge request apipark/APIPark!253
2025-03-10 17:47:52 +08:00
刘健 afc8fe4167 Merge branch 'feature/1.6-liujian' into 'main'
Feature/1.6 liujian

See merge request apipark/APIPark!252
2025-03-10 14:54:42 +08:00
lichunxian f1333b68b6 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!251
2025-03-10 11:41:45 +08:00
孙安智 69bbdb3d02 Merge branch 'feature/sunanzhi/1.6' into 'main'
feat: add provider type field

See merge request apipark/APIPark!250
2025-03-10 10:44:42 +08:00
lichunxian 7645134b35 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!249
2025-03-10 10:35:10 +08:00
lichunxian 0250e65959 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!248
2025-03-10 10:10:30 +08:00
lichunxian fecfea5dad Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!247
2025-03-10 09:45:58 +08:00
孙安智 cac95019b6 Merge branch 'feature/sunanzhi/1.6' into 'main'
fix: resolve duplicate linked list data in model caused by updating vendor

See merge request apipark/APIPark!246
2025-03-07 20:09:21 +08:00
孙安智 88022a8edd Merge branch 'feature/sunanzhi/1.6' into 'main'
Feature/sunanzhi/1.6

See merge request apipark/APIPark!245
2025-03-07 19:54:11 +08:00
孙安智 b6ededa2c4 Merge branch 'feature/sunanzhi/1.6' into 'main'
refactor: adjust model_runtime structure of provider model

See merge request apipark/APIPark!244
2025-03-07 18:43:45 +08:00
孙安智 b098a09425 Merge branch 'feature/sunanzhi/1.6' into 'main'
fix: resolve build failure due to unused model variable

See merge request apipark/APIPark!243
2025-03-07 15:09:25 +08:00
孙安智 a1dcbd23b7 Merge branch 'feature/sunanzhi/1.6' into 'main'
fix: resolve null pointer due to empty validator and comment out release model code

See merge request apipark/APIPark!242
2025-03-07 14:58:33 +08:00
孙安智 b71615597b Merge branch 'feature/sunanzhi/1.6' into 'main'
fix: resolve error caused by fetching empty vendor config model

See merge request apipark/APIPark!241
2025-03-07 14:33:49 +08:00
lichunxian 32b5f90e86 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!240
2025-03-07 14:24:57 +08:00
孙安智 7ff4b77505 Merge branch 'feature/sunanzhi/1.6' into 'main'
fix: resolve package error when LLMs list is empty

See merge request apipark/APIPark!239
2025-03-07 14:14:53 +08:00
孙安智 75a5416fad Merge branch 'feature/sunanzhi/1.6' into 'main'
fix: fix null pointer in unconfigured provider fetch, add model name to list

See merge request apipark/APIPark!238
2025-03-07 11:41:31 +08:00
孙安智 4c415a47f8 Merge branch 'feature/sunanzhi/1.6' into 'main'
feat: add API endpoint to retrieve model configuration template

See merge request apipark/APIPark!237
2025-03-07 11:16:33 +08:00
lichunxian 954c7f2192 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!236
2025-03-07 11:06:38 +08:00
孙安智 1aa95fb972 Merge branch 'feature/sunanzhi/1.6' into 'main'
Add support for creating online models and integrating custom model providers

See merge request apipark/APIPark!235
2025-03-07 09:26:32 +08:00
lichunxian 5d71a8d7c5 Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!234
2025-03-06 16:17:17 +08:00
lichunxian 4f7ca8018c Merge branch 'feature/1.6-cx' into 'main'
feat: feature/1.6-Integrate custom model

See merge request apipark/APIPark!233
2025-03-06 11:34:50 +08:00
李业昌 c167712b0e Merge branch 'feature/dashen/model_mapping' into 'main'
Feature/dashen/model mapping

See merge request apipark/APIPark!231
2025-03-05 10:50:06 +08:00
lichunxian a8b4599c4f Merge branch 'feature/1.5-cx' into 'main'
Feature/1.5 cx

See merge request apipark/APIPark!230
2025-03-03 14:20:46 +08:00
lichunxian 25ad26ad55 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!229
2025-02-20 18:36:14 +08:00
刘健 cf27da94a7 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!228
2025-02-20 14:25:08 +08:00
lichunxian a43880fbcc Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!227
2025-02-20 14:20:14 +08:00
lichunxian e04282e3a4 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!226
2025-02-20 13:52:30 +08:00
lichunxian 98bde0a1c0 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!225
2025-02-20 11:37:17 +08:00
lichunxian 3e3227755b Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!224
2025-02-19 18:19:58 +08:00
刘健 5c58283264 Merge branch 'feature/1.5-local-model' into 'main'
Fix: Issue of failed update service

See merge request apipark/APIPark!223
2025-02-19 18:00:04 +08:00
lichunxian 2c7680bedc Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!222
2025-02-19 17:57:28 +08:00
刘健 db2e05889d Merge branch 'feature/1.5-local-model' into 'main'
Add model information field to service information

See merge request apipark/APIPark!221
2025-02-19 17:24:27 +08:00
lichunxian 517ac1eeac Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!220
2025-02-19 16:06:00 +08:00
刘健 63fbd35c63 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!219
2025-02-19 10:58:00 +08:00
lichunxian 6d55676aa9 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!218
2025-02-19 10:23:47 +08:00
lichunxian 48f8bc0c8e Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!217
2025-02-19 09:35:31 +08:00
lichunxian 463f063932 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!216
2025-02-19 09:28:04 +08:00
lichunxian 11bc0331cf Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!215
2025-02-18 22:18:03 +08:00
lichunxian 6af33ee5b7 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!214
2025-02-18 19:52:13 +08:00
lichunxian e289537fd9 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!212
2025-02-18 16:00:41 +08:00
刘健 7adbbc31c2 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!213
2025-02-18 15:43:45 +08:00
lichunxian 2e383282c8 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!211
2025-02-17 20:15:54 +08:00
刘健 7c913a4cb6 Update .gitlab-ci.yml file 2025-02-17 20:14:06 +08:00
刘健 42e3384ebb Update .gitlab-ci.yml file 2025-02-17 19:37:30 +08:00
刘健 8610cd5770 Merge branch 'feature/1.5-local-model' into 'main'
update service list sort

See merge request apipark/APIPark!210
2025-02-17 18:32:34 +08:00
刘健 1f240581d2 Merge branch 'feature/1.5-local-model' into 'main'
init service consumer

See merge request apipark/APIPark!209
2025-02-17 18:14:37 +08:00
刘健 a0b2148b65 Merge branch 'feature/1.5-local-model' into 'main'
init service consumer

See merge request apipark/APIPark!208
2025-02-17 18:12:32 +08:00
刘健 2619493362 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!207
2025-02-17 17:42:16 +08:00
lichunxian da37970a43 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!206
2025-02-17 16:34:45 +08:00
刘健 6879a97e36 Merge branch 'feature/1.5-local-model' into 'main'
Fix: Service List AI Entry Error

See merge request apipark/APIPark!205
2025-02-17 16:12:38 +08:00
刘健 dd7f9c9f5f Merge branch 'feature/1.5-local-model' into 'main'
fix: ai deploy bug

See merge request apipark/APIPark!204
2025-02-17 15:24:28 +08:00
lichunxian 31a1703ba8 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!203
2025-02-17 15:17:11 +08:00
刘健 81a9c35cda Merge branch 'feature/1.5-local-model' into 'main'
add:init ai balance

See merge request apipark/APIPark!202
2025-02-17 11:42:07 +08:00
lichunxian bd9e99890d Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!201
2025-02-17 11:32:25 +08:00
lichunxian fe30521c24 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!200
2025-02-17 11:07:23 +08:00
刘健 06e7d96f67 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!199
2025-02-17 10:45:56 +08:00
刘健 666acb6241 Merge branch 'feature/1.5-local-model' into 'main'
fix: ai deploy bug

See merge request apipark/APIPark!198
2025-02-17 00:37:59 +08:00
刘健 1c499ae805 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!197
2025-02-16 21:51:20 +08:00
刘健 0153612020 Merge branch 'feature/1.5-local-model' into 'main'
fix:bug

See merge request apipark/APIPark!196
2025-02-16 00:57:43 +08:00
lichunxian d27f7eba4d Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!195
2025-02-15 18:51:16 +08:00
lichunxian 4c60acb5bb Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!194
2025-02-15 18:31:38 +08:00
lichunxian 3de5221b4a Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!193
2025-02-15 18:12:31 +08:00
刘健 3e0070db80 Merge branch 'feature/1.5-local-model' into 'main'
本地模型列表新增provider

See merge request apipark/APIPark!192
2025-02-15 17:59:48 +08:00
lichunxian b347d8f08c Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!191
2025-02-15 17:45:01 +08:00
lichunxian 11ae2969b4 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!190
2025-02-15 17:27:35 +08:00
lichunxian b6d2abaa64 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!189
2025-02-15 17:16:20 +08:00
刘健 3e79f117a3 Merge branch 'feature/1.5-local-model' into 'main'
update api doc

See merge request apipark/APIPark!188
2025-02-15 10:58:52 +08:00
刘健 13517c835c Merge branch 'feature/1.5-local-model' into 'main'
fix:bug

See merge request apipark/APIPark!187
2025-02-15 10:57:04 +08:00
lichunxian 8ec82bc9ba Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!186
2025-02-15 10:14:02 +08:00
刘健 5205764fae Merge branch 'feature/1.5-local-model' into 'main'
Fix: AI model list keyword query failure issue

See merge request apipark/APIPark!185
2025-02-14 23:47:05 +08:00
刘健 16d1e8f3d7 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!184
2025-02-14 23:27:54 +08:00
lichunxian e6684244d1 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!183
2025-02-14 22:24:15 +08:00
lichunxian 976f3505bf Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!182
2025-02-14 21:52:42 +08:00
刘健 f91b83385f Merge branch 'feature/1.5-local-model' into 'main'
update model colomn length

See merge request apipark/APIPark!181
2025-02-14 21:20:15 +08:00
刘健 6797ff023d Merge branch 'feature/1.5-local-model' into 'main'
add ollama logo

See merge request apipark/APIPark!180
2025-02-14 21:10:43 +08:00
lichunxian 528bb727ad Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!179
2025-02-14 20:57:39 +08:00
lichunxian e0c482efbc Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!178
2025-02-14 20:45:18 +08:00
刘健 cf285f0637 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!177
2025-02-14 20:25:11 +08:00
lichunxian d4c697d680 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!176
2025-02-14 18:51:23 +08:00
刘健 d90dc847ef Merge branch 'feature/1.5-local-model' into 'main'
update role permission

See merge request apipark/APIPark!175
2025-02-14 18:41:50 +08:00
刘健 8707a01fd3 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!174
2025-02-14 18:36:43 +08:00
lichunxian 2c95e440d1 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!173
2025-02-14 18:05:18 +08:00
lichunxian b06c880a9c Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Data Integration

See merge request apipark/APIPark!172
2025-02-14 17:44:15 +08:00
刘健 b5d70ca524 Merge branch 'feature/1.5-local-model' into 'main'
Fix: Local model deployment status error

See merge request apipark/APIPark!171
2025-02-14 17:24:58 +08:00
刘健 d41afdd2da Merge branch 'feature/1.5-local-model' into 'main'
update deploy status

See merge request apipark/APIPark!170
2025-02-14 17:07:21 +08:00
lichunxian 5253a62f9a Merge branch 'feature/1.5-cx' into 'main'
feat: Local deployment popup optimization

See merge request apipark/APIPark!169
2025-02-14 16:46:31 +08:00
刘健 125f59b1e1 Merge branch 'feature/1.5-local-model' into 'main'
Feature/1.5 local model

See merge request apipark/APIPark!168
2025-02-14 16:36:02 +08:00
lichunxian e18a6ef1c6 Merge branch 'feature/1.5-cx' into 'main'
feat: Local deployment popup optimization

See merge request apipark/APIPark!167
2025-02-14 15:40:35 +08:00
lichunxian f65a908661 Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5-Model Deployment Process Popup Optimization

See merge request apipark/APIPark!166
2025-02-13 18:24:20 +08:00
lichunxian 93f1a76efb Merge branch 'feature/1.5-cx' into 'main'
feat: feature/1.5

See merge request apipark/APIPark!165
2025-02-13 17:03:58 +08:00
lichunxian c36ff21b91 Merge branch 'feature/1.5-cx' into 'main'
feat:Feature/1.5 cx

See merge request apipark/APIPark!164
2025-02-13 10:09:18 +08:00
28 changed files with 432 additions and 309 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ body:
label: Environment
description: Share your environment details. Reports without proper environment details will likely be closed.
value: |
- APINTO Dashboard version:
- ApiPark version:
- Operating system (run `uname -a`):
validations:
required: true
File diff suppressed because it is too large Load Diff
@@ -1,7 +1,7 @@
provider: bailian
label:
zh_Hans: 阿里云百炼
en_US: bailian
en_US: BaiLian
icon_small:
en_US: icon_s_en.svg
icon_large:
@@ -89,7 +89,7 @@ provider_credential_schema:
zh_Hans: 为了进行验证,请输入一个您可用的模型名称 (例如:amazon.titan-text-lite-v1)
model_config:
access_configuration_status: true
access_configuration_demo: "{}"
access_configuration_demo: "{\"region\":\"\",\"model\":\"\"}"
address: https://bedrock-runtime.amazonaws.com
sort: 4
recommend: true
@@ -1,11 +1 @@
<svg width="80" height="22" viewBox="0 0 80 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group">
<path id="Vector" d="M25.1152 10.5768C25.1152 14.1739 27.4253 16.6819 30.6264 16.6819C33.8274 16.6819 36.1375 14.1739 36.1375 10.5768C36.1375 6.97973 33.8274 4.47168 30.6264 4.47168C27.4253 4.47168 25.1152 6.97973 25.1152 10.5768ZM34.0254 10.5768C34.0254 13.1509 32.6229 14.8174 30.6264 14.8174C28.6298 14.8174 27.2273 13.1509 27.2273 10.5768C27.2273 8.00275 28.6298 6.33622 30.6264 6.33622C32.6229 6.33622 34.0254 8.00275 34.0254 10.5768Z" fill="black"/>
<path id="Vector_2" d="M42.0868 16.682C44.5124 16.682 45.8984 14.636 45.8984 12.1774C45.8984 9.71889 44.5124 7.67285 42.0868 7.67285C40.9648 7.67285 40.1398 8.11836 39.5953 8.76188V7.83786H37.6152V19.4706H39.5953V15.593C40.1398 16.2365 40.9648 16.682 42.0868 16.682ZM39.5458 11.9299C39.5458 10.2964 40.4698 9.40539 41.6908 9.40539C43.1264 9.40539 43.9019 10.5274 43.9019 12.1774C43.9019 13.8275 43.1264 14.9495 41.6908 14.9495C40.4698 14.9495 39.5458 14.042 39.5458 12.4415V11.9299Z" fill="black"/>
<path id="Vector_3" d="M51.2545 16.682C52.987 16.682 54.3565 15.7745 54.967 14.2565L53.2675 13.613C53.0035 14.504 52.228 14.999 51.2545 14.999C49.9839 14.999 49.0929 14.0915 48.9444 12.6065H55.0165V11.9464C55.0165 9.57039 53.68 7.67285 51.172 7.67285C48.6639 7.67285 47.0469 9.63639 47.0469 12.1774C47.0469 14.8505 48.7794 16.682 51.2545 16.682ZM51.1555 9.33939C52.4095 9.33939 53.0035 10.1644 53.02 11.1214H49.0434C49.3404 9.9499 50.1324 9.33939 51.1555 9.33939Z" fill="black"/>
<path id="Vector_4" d="M56.5038 16.5005H58.4838V11.4184C58.4838 10.1809 59.3913 9.52089 60.2824 9.52089C61.3714 9.52089 61.8004 10.2964 61.8004 11.3689V16.5005H63.7804V10.7914C63.7804 8.92688 62.6914 7.67285 60.8764 7.67285C59.7544 7.67285 58.9788 8.18436 58.4838 8.76188V7.83786H56.5038V16.5005Z" fill="black"/>
<path id="Vector_5" d="M69.5799 4.65332L65.0918 16.5006H67.1873L68.1939 13.7945H73.309L74.332 16.5006H76.4605L71.9724 4.65332H69.5799ZM70.7349 6.99637L72.616 11.9465H68.8869L70.7349 6.99637Z" fill="black"/>
<path id="Vector_6" d="M79.8581 4.6875H77.7461V16.5348H79.8581V4.6875Z" fill="black"/>
<path id="Vector_7" d="M20.2769 9.00448C20.776 7.50639 20.6041 5.86529 19.8059 4.50264C18.6055 2.41259 16.1924 1.33732 13.8356 1.84333C12.7871 0.662179 11.2808 -0.00952316 9.70154 0.000102043C7.29248 -0.00539807 5.155 1.54563 4.41386 3.83781C2.86626 4.15475 1.53042 5.12346 0.748717 6.49643C-0.460621 8.58097 -0.184928 11.2087 1.43073 12.9962C0.931596 14.4943 1.10348 16.1354 1.90168 17.498C3.10208 19.5881 5.51526 20.6634 7.87206 20.1573C8.91983 21.3385 10.4269 22.0102 12.0061 21.9999C14.4165 22.0061 16.5547 20.4537 17.2958 18.1594C18.8434 17.8425 20.1793 16.8738 20.961 15.5008C22.1689 13.4163 21.8925 10.7906 20.2776 9.00311L20.2769 9.00448ZM12.0075 20.5623C11.0429 20.5637 10.1085 20.2261 9.36809 19.608C9.40178 19.5901 9.46022 19.5578 9.49803 19.5345L13.8789 17.0044C14.103 16.8772 14.2405 16.6386 14.2391 16.3808V10.2049L16.0906 11.274C16.1105 11.2836 16.1236 11.3028 16.1264 11.3248V16.4393C16.1236 18.7136 14.2818 20.5575 12.0075 20.5623ZM3.14952 16.7789C2.6662 15.9443 2.49225 14.9659 2.65795 14.0165C2.69026 14.0357 2.74732 14.0708 2.78789 14.0942L7.16873 16.6242C7.3908 16.7541 7.6658 16.7541 7.88856 16.6242L13.2367 13.5359V15.6741C13.2381 15.6961 13.2278 15.7174 13.2106 15.7311L8.78233 18.288C6.80985 19.4238 4.29079 18.7486 3.15021 16.7789H3.14952ZM1.99656 7.21626C2.47782 6.38024 3.23752 5.74085 4.14229 5.40878C4.14229 5.44659 4.14023 5.51328 4.14023 5.56003V10.6208C4.13885 10.878 4.27636 11.1165 4.4998 11.2437L9.84798 14.3313L7.9965 15.4004C7.97794 15.4128 7.95456 15.4149 7.93393 15.4059L3.50496 12.847C1.53661 11.7071 0.86147 9.18874 1.99587 7.21694L1.99656 7.21626ZM17.2085 10.7563L11.8603 7.66795L13.7118 6.59956C13.7304 6.58718 13.7537 6.58512 13.7744 6.59406L18.2033 9.15092C20.1751 10.2901 20.851 12.8126 19.7118 14.7844C19.2298 15.6191 18.4708 16.2584 17.5667 16.5912V11.3792C17.5688 11.122 17.432 10.8841 17.2092 10.7563H17.2085ZM19.0511 7.98284C19.0187 7.9629 18.9617 7.92852 18.9211 7.90515L14.5403 5.37509C14.3182 5.24515 14.0432 5.24515 13.8204 5.37509L8.47226 8.46341V6.32524C8.47088 6.30324 8.4812 6.28192 8.49838 6.26817L12.9267 3.71337C14.8991 2.57553 17.4209 3.25273 18.5581 5.2259C19.0387 6.05917 19.2126 7.03475 19.0497 7.98284H19.0511ZM7.46574 11.7937L5.61357 10.7246C5.59363 10.715 5.58057 10.6958 5.57782 10.6738V5.55935C5.5792 3.2823 7.42655 1.43701 9.7036 1.43838C10.6668 1.43838 11.5991 1.77664 12.3395 2.39265C12.3058 2.41053 12.2481 2.44284 12.2096 2.46622L7.82874 4.99627C7.60461 5.12346 7.46711 5.36134 7.46849 5.61916L7.46574 11.7924V11.7937ZM8.47157 9.62531L10.8538 8.24959L13.236 9.62462V12.3754L10.8538 13.7504L8.47157 12.3754V9.62531Z" fill="black"/>
</g>
</svg>
<svg fill="currentColor" fill-rule="evenodd" height="56" viewBox="0 0 24 24" width="56" xmlns="http://www.w3.org/2000/svg" style="flex: 0 0 auto; line-height: 1;"><title>LM Studio</title><path d="M2.84 2a1.273 1.273 0 100 2.547h14.107a1.273 1.273 0 100-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H22.04a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h14.106a1.274 1.274 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H15.38a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h14.106a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h9.698a1.273 1.273 0 100-2.547h-9.698z" fill-opacity=".3"></path><path d="M2.84 2a1.273 1.273 0 100 2.547h10.287a1.274 1.274 0 000-2.547H2.84zM7.935 5.33a1.273 1.273 0 000 2.548H18.22a1.274 1.274 0 000-2.547H7.935zM3.624 9.935c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 010 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM1.273 12.188a1.273 1.273 0 100 2.547H11.56a1.274 1.274 0 000-2.547H1.273zM3.624 16.792c0-.704.57-1.274 1.274-1.274h10.286a1.273 1.273 0 110 2.547H4.898c-.703 0-1.274-.57-1.274-1.273zM13.029 18.849a1.273 1.273 0 100 2.547h5.78a1.273 1.273 0 100-2.547h-5.78z"></path></svg>

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 17 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 17 KiB

@@ -29,12 +29,12 @@ provider_credential_schema:
placeholder:
zh_Hans: 在此输入您的 API Key
en_US: Enter your API Key
- variable: base_url
- variable: dashscope_api_base
label:
en_US: https://api.baichuan-ai.com/v1
en_US: https://dashscope.aliyuncs.com/compatible-mode/v1
type: text-input
required: false
placeholder:
zh_Hans: 在此输入您的 Base URL
en_US: Enter your Base URL
address: https://api.baichuan-ai.com/v1
address: https://dashscope.aliyuncs.com/compatible-mode/v1
+1 -1
View File
@@ -81,7 +81,7 @@ func convertInt(value interface{}) int {
func genAIKey(key string, provider string) string {
keys := strings.Split(key, "@")
return strings.TrimSuffix(keys[0], fmt.Sprintf("-%s", provider))
return strings.TrimPrefix(keys[0], fmt.Sprintf("%s-", provider))
}
// HandleMessage 处理从 NSQ 读取的消息
+1 -1
View File
@@ -267,7 +267,7 @@ func (i *imlLocalModelController) initAILocalService(ctx context.Context, model
})
return func() error {
path := fmt.Sprintf("/%s/chat", strings.Trim(prefix, "/"))
path := fmt.Sprintf("/%s/chat/completions", strings.Trim(prefix, "/"))
timeout := 300000
retry := 0
aiPrompt := &ai_api_dto.AiPrompt{
+2 -1
View File
@@ -354,7 +354,8 @@ func (i *imlServiceController) createAIService(ctx *gin.Context, teamID string,
if !has {
return nil, fmt.Errorf("model %s not found", pv.DefaultLLM)
}
modelId = m.ID()
//modelId = m.ID()
modelId = m.Name()
modelCfg = m.DefaultConfig()
}
+21 -21
View File
@@ -395,36 +395,36 @@ func (i *imlInitController) createAIService(ctx context.Context, teamID string,
if err != nil {
return err
}
path := fmt.Sprintf("/%s/demo_translation_api", strings.Trim(input.Prefix, "/"))
path := fmt.Sprintf("/%s/chat/completions", strings.Trim(input.Prefix, "/"))
timeout := 300000
retry := 0
aiPrompt := &ai_api_dto.AiPrompt{
Variables: []*ai_api_dto.AiPromptVariable{
{
Key: "source_lang",
Description: "",
Require: true,
},
{
Key: "target_lang",
Description: "",
Require: true,
},
{
Key: "text",
Description: "",
Require: true,
},
},
Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}",
//Variables: []*ai_api_dto.AiPromptVariable{
// {
// Key: "source_lang",
// Description: "",
// Require: true,
// },
// {
// Key: "target_lang",
// Description: "",
// Require: true,
// },
// {
// Key: "text",
// Description: "",
// Require: true,
// },
//},
//Prompt: "You need to translate {{source_lang}} into {{target_lang}}, and the following is the content that needs to be translated.\n---\n{{text}}",
}
aiModel := &ai_api_dto.AiModel{
Id: m.ID(),
Config: m.DefaultConfig(),
Provider: providerId,
}
name := "Demo Translation API"
description := "A demo that shows you how to use a prompt to create a Translation API."
name := "Demo Chat API"
description := "A demo that shows you how to use a prompt to create a Chat API."
apiId := uuid.New().String()
err = i.aiAPIModule.Create(
ctx,
@@ -1,5 +1,5 @@
import { App, Col, Form, Input, Row, Table, Tooltip } from 'antd'
import { forwardRef, useEffect, useImperativeHandle, useMemo } from 'react'
import { forwardRef, useEffect, useImperativeHandle, useMemo, useRef } from 'react'
import {
PublishApprovalInfoType,
PublishApprovalModalHandle,
@@ -36,6 +36,7 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
const [form] = Form.useForm()
const { fetchData } = useFetch()
const { state } = useGlobalContext()
const versionInputRef = useRef<Input>(null)
const save: (operate: 'pass' | 'refuse') => Promise<boolean | string> = (operate) => {
if (type === 'view') {
@@ -140,6 +141,12 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
useEffect(() => {
form.setFieldsValue({ opinion: '', ...data })
// 如果是添加模式且insidePage为true,自动聚焦版本号输入框
if (type === 'add' && insidePage && versionInputRef.current) {
setTimeout(() => {
versionInputRef.current?.focus()
}, 100)
}
}, [])
const translatedUpstreamColumns = useMemo(
@@ -335,7 +342,12 @@ export const PublishApprovalModalContent = forwardRef<PublishApprovalModalHandle
{insidePage && (
<>
<Form.Item label={$t('版本号')} name="version" rules={[{ required: true, whitespace: true }]}>
<Input className="w-INPUT_NORMAL" disabled={type !== 'add'} placeholder={$t(PLACEHOLDER.input)} />
<Input
className="w-INPUT_NORMAL"
disabled={type !== 'add'}
placeholder={$t(PLACEHOLDER.input)}
ref={versionInputRef}
/>
</Form.Item>
<Form.Item label={$t('版本说明')} name="versionRemark">
@@ -91,8 +91,15 @@ const AIProviderSelect: React.FC<AIProviderSelectProps> = ({ value, onChange, so
label: (
<Space className="flex items-center">
<span
className="flex items-center h-[20px] w-[20px]"
dangerouslySetInnerHTML={{ __html: provider.logo }}
className="flex items-center justify-center h-[20px] w-[20px] overflow-hidden"
style={{
display: 'flex',
alignItems: 'center',
justifyContent: 'center'
}}
dangerouslySetInnerHTML={{
__html: provider.logo.replace(/<svg/, '<svg style="max-width:100%;max-height:100%;width:auto;height:auto;"')
}}
></span>
<span>{provider.name}</span>
</Space>
@@ -10,7 +10,7 @@ import { DefaultOptionType } from 'antd/es/select'
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'
export type AiServiceRouterModelConfigHandle = {
save: () => Promise<{ id: string; config: string, type: string, provider: string }>
save: () => Promise<{ id: string; config: string; type: string; provider: string }>
}
export type AiServiceRouterModelConfigProps = {
@@ -49,7 +49,7 @@ const AiServiceRouterModelConfig = forwardRef<AiServiceRouterModelConfigHandle,
/**
* 获取本地模型列表
* @param setDefaultValue
* @param setDefaultValue
*/
const getLocalLlmList = (setDefaultValue?: boolean) => {
fetchData<LocalLlmType[]>('simple/ai/models/local/configured', {
@@ -113,12 +113,11 @@ const AiServiceRouterModelConfig = forwardRef<AiServiceRouterModelConfigHandle,
const { code, data, msg } = response
if (code === STATUS_CODE.SUCCESS) {
setProviderList(
data.providers
?.map((x: SimpleAiProviderItem) => {
return { ...x, label: x.name, value: x.id }
})
data.providers?.map((x: SimpleAiProviderItem) => {
return { ...x, label: x.name, value: x.id }
})
)
if (setDefaultValue && data.providers.length) {
if (setDefaultValue && data.providers.length) {
const id = data.providers[0].id
form.setFieldValue('provider', id)
getLlmList(id)
@@ -179,9 +178,14 @@ const AiServiceRouterModelConfig = forwardRef<AiServiceRouterModelConfigHandle,
rules={[{ required: true }]}
>
<Select
showSearch
className="w-INPUT_NORMAL"
filterOption={(input, option) => (option?.searchText ?? '').includes(input.toLowerCase())}
placeholder={$t(PLACEHOLDER.select)}
options={providerList}
options={providerList.map((x) => ({
...x,
searchText: x.name.toLowerCase()
}))}
onChange={(e) => {
getLlmList(e)
}}
@@ -191,19 +195,20 @@ const AiServiceRouterModelConfig = forwardRef<AiServiceRouterModelConfigHandle,
<Form.Item<AiServiceRouterModelConfigField> label={$t('模型')} name="id" rules={[{ required: true }]}>
<Select
showSearch
className="w-INPUT_NORMAL"
placeholder={$t(PLACEHOLDER.select)}
options={
llmList?.map((x) => ({
value: x.id,
label: (
<div className="flex items-center gap-[10px]" key={x.id}>
<span>{x.name || x.id}</span>
{modelType === 'online' && x?.scopes?.map((s: any) => <Tag>{s?.toLocaleUpperCase()}</Tag>)}
</div>
)
}))
}
filterOption={(input, option) => (option?.searchText ?? '').includes(input.toLowerCase())}
options={llmList?.map((x) => ({
value: x.id,
label: (
<div className="flex items-center gap-[10px]" key={x.id}>
<span>{x.name || x.id}</span>
{modelType === 'online' && x?.scopes?.map((s: any) => <Tag>{s?.toLocaleUpperCase()}</Tag>)}
</div>
),
searchText: x.name.toLowerCase()
}))}
onChange={(e) => {
form.setFieldValue('config', llmList.find((x) => x.id === e)?.config)
}}
@@ -182,7 +182,9 @@ const AddLoadBalancingModel = forwardRef<LoadBalancingHandle>((props, ref: any)
{modelType === 'online' && (
<Form.Item<LoadModelDetailData> label={$t('模型供应商')} name="provider" rules={[{ required: true }]}>
<Select
showSearch
className="w-INPUT_NORMAL"
filterOption={(input, option) => (option?.searchText ?? '').includes(input.toLowerCase())}
placeholder={$t(PLACEHOLDER.select)}
loading={modelProviderLoading}
options={modelProviderData?.map((x) => ({
@@ -191,7 +193,8 @@ const AddLoadBalancingModel = forwardRef<LoadBalancingHandle>((props, ref: any)
<div className="flex items-center gap-[10px]">
<span>{x.name}</span>
</div>
)
),
searchText: x.name.toLowerCase()
}))}
onChange={(e) => {
modelProviderChange(e)
@@ -201,8 +204,10 @@ const AddLoadBalancingModel = forwardRef<LoadBalancingHandle>((props, ref: any)
)}
<Form.Item label={$t('模型')} name="model" className="mt-[16px]" rules={[{ required: true }]}>
<Select
showSearch
className="w-INPUT_NORMAL"
placeholder={$t(PLACEHOLDER.input)}
filterOption={(input, option) => (option?.searchText ?? '').includes(input.toLowerCase())}
loading={llmListLoading}
options={
llmList?.map((x) => ({
@@ -212,7 +217,8 @@ const AddLoadBalancingModel = forwardRef<LoadBalancingHandle>((props, ref: any)
<span>{x.name || x.id}</span>
{ modelType === 'online' &&x?.scopes?.map((s: any) => <Tag key={s}>{s?.toLocaleUpperCase()}</Tag>)}
</div>
)
),
searchText: x.name.toLowerCase()
}))
}
onChange={(value) => {
@@ -450,9 +450,14 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_, ref) => {
>
{providerOptionList && providerOptionList.length > 0 ? (
<Select
showSearch
className="w-INPUT_NORMAL"
filterOption={(input, option) => (option?.searchText ?? '').includes(input.toLowerCase())}
placeholder={$t(PLACEHOLDER.input)}
options={providerOptionList}
options={providerOptionList.map((x) => ({
...x,
searchText: x.name.toLowerCase()
}))}
onChange={(e) => {
modelProviderChange(e)
}}
@@ -467,7 +472,16 @@ const SystemConfig = forwardRef<SystemConfigHandle>((_, ref) => {
)}
</Form.Item>
<Form.Item<AiServiceConfigFieldType> label={$t('默认模型')} name="model" rules={[{ required: true }]}>
<Select className="w-INPUT_NORMAL" placeholder={$t(PLACEHOLDER.input)} options={modelList}></Select>
<Select
showSearch
filterOption={(input, option) => (option?.searchText ?? '').includes(input.toLowerCase())}
className="w-INPUT_NORMAL"
placeholder={$t(PLACEHOLDER.input)}
options={modelList ? modelList.map((x) => ({
...x,
searchText: x.name.toLowerCase()
})) : []}
></Select>
</Form.Item>
</>
)}
+20
View File
@@ -23,12 +23,32 @@ func genOperation(summary string, description string, variables []*ai_api_dto.Ai
operation := openapi3.NewOperation()
operation.Summary = summary
operation.Description = description
operation.AddParameter(&openapi3.Parameter{
Name: "Authorization",
In: "header",
Required: true,
Example: "{your_apipark_apikey}",
})
operation.RequestBody = genRequestBody(variables)
operation.Responses = &openapi3.Responses{}
operation.Responses.Set("200", genResponse())
return operation
}
func genRequestHeaders() openapi3.Parameters {
return openapi3.Parameters{
{
Value: &openapi3.Parameter{
Name: "Authorization",
In: "header",
Description: "your_apipark_apikey", // 替换Prompt的变量列表
Required: true,
Example: "your_apipark_apikey",
},
},
}
}
func genRequestParameters(variables []*ai_api_dto.AiPromptVariable) openapi3.Parameters {
return openapi3.Parameters{
{
+10 -3
View File
@@ -220,7 +220,8 @@ func (i *imlBalanceModule) Delete(ctx context.Context, id string) error {
return i.syncGateway(ctx, cluster.DefaultClusterID, []*gateway.DynamicRelease{
{
BasicItem: &gateway.BasicItem{
ID: id,
ID: id,
Resource: "ai-provider",
},
},
}, false)
@@ -267,7 +268,8 @@ func (i *imlBalanceModule) getLocalBalances(ctx context.Context, v string) ([]*g
var has bool
v, has = i.settingService.Get(ctx, "system.ai_model.ollama_address")
if !has {
return nil, fmt.Errorf("ollama address not found")
//return nil, fmt.Errorf("ollama address not found")
return nil, nil
}
}
@@ -293,7 +295,8 @@ func (i *imlBalanceModule) getBalances(ctx context.Context) ([]*gateway.DynamicR
}
v, has := i.settingService.Get(ctx, "system.ai_model.ollama_address")
if !has {
return nil, fmt.Errorf("ollama address not found")
//return nil, fmt.Errorf("ollama address not found")
return nil, nil
}
releases := make([]*gateway.DynamicRelease, 0, len(balances))
for _, item := range balances {
@@ -304,6 +307,10 @@ func (i *imlBalanceModule) getBalances(ctx context.Context) ([]*gateway.DynamicR
continue
}
base = fmt.Sprintf("%s://%s%s", p.URI().Scheme(), p.URI().Host(), p.URI().Path())
} else {
if v == "" {
continue
}
}
releases = append(releases, newRelease(item, base))
}
+3 -3
View File
@@ -383,12 +383,12 @@ func (i *imlKeyModule) UpdateKeyStatus(ctx context.Context, providerId string, i
}
releases := []*gateway.DynamicRelease{{
BasicItem: &gateway.BasicItem{
ID: id,
ID: fmt.Sprintf("%s-%s", providerId, id),
Resource: "ai-key",
},
Attr: nil,
}}
return i.syncGateway(ctx, providerId, releases, false)
return i.syncGateway(ctx, cluster.DefaultClusterID, releases, false)
}
if info.Status == ai_key_dto.KeyDisable.Int() || info.Status == ai_key_dto.KeyExceed.Int() {
// 超额 或 停用状态,可启用
@@ -411,7 +411,7 @@ func (i *imlKeyModule) UpdateKeyStatus(ctx context.Context, providerId string, i
return err
}
releases := []*gateway.DynamicRelease{newKey(info)}
return i.syncGateway(ctx, providerId, releases, true)
return i.syncGateway(ctx, cluster.DefaultClusterID, releases, true)
}
return nil
})
+29 -7
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"time"
ai_balance "github.com/APIParkLab/APIPark/service/ai-balance"
@@ -60,6 +61,7 @@ func (i *imlLocalModel) SyncLocalModels(ctx context.Context, address string) err
if err != nil {
return err
}
return i.syncGateway(ctx, cluster.DefaultClusterID, releases, true)
}
@@ -246,7 +248,7 @@ func (i *imlLocalModel) pullHook(fn ...func() error) func(msg ai_provider_local.
v, _ := i.settingService.Get(ctx, "system.ai_model.ollama_address")
cfg := make(map[string]interface{})
cfg["provider"] = "ollama"
cfg["provider"] = ai_provider_local.ProviderLocal
cfg["model"] = msg.Model
cfg["model_config"] = ai_provider_local.LocalConfig
cfg["priority"] = 0
@@ -448,7 +450,7 @@ func (i *imlLocalModel) Enable(ctx context.Context, model string) error {
}
v, _ := i.settingService.Get(ctx, "system.ai_model.ollama_address")
cfg := make(map[string]interface{})
cfg["provider"] = "ollama"
cfg["provider"] = ai_provider_local.ProviderLocal
cfg["model"] = info.Id
cfg["model_config"] = ai_provider_local.LocalConfig
cfg["priority"] = 0
@@ -512,8 +514,8 @@ func (i *imlLocalModel) OnInit() {
})
models, version := ai_provider_local.ModelsCanInstall()
for _, model := range models {
if v, ok := oldModels[model.Id]; ok {
delete(oldModels, model.Id)
if v.Version == version {
continue
}
@@ -541,7 +543,7 @@ func (i *imlLocalModel) OnInit() {
return
}
}
delete(oldModels, model.Id)
}
for id := range oldModels {
err = i.localModelPackageService.Delete(ctx, id)
@@ -612,17 +614,18 @@ func (i *imlLocalModel) getLocalModels(ctx context.Context, v string) ([]*gatewa
var has bool
v, has = i.settingService.Get(ctx, "system.ai_model.ollama_address")
if !has {
return nil, errors.New("ollama_address not set")
//return nil, errors.New("ollama_address not set")
return nil, nil
}
}
provider := ai_provider_local.ProviderLocal
releases := make([]*gateway.DynamicRelease, 0, len(list))
for _, l := range list {
if l.State != ai_local_dto.LocalModelStateNormal.Int() {
continue
}
cfg := make(map[string]interface{})
cfg["provider"] = "ollama"
cfg["provider"] = provider
cfg["model"] = l.Id
cfg["model_config"] = ai_provider_local.LocalConfig
cfg["base"] = v
@@ -639,6 +642,25 @@ func (i *imlLocalModel) getLocalModels(ctx context.Context, v string) ([]*gatewa
Attr: cfg,
})
}
releases = append(releases, &gateway.DynamicRelease{
BasicItem: &gateway.BasicItem{
ID: fmt.Sprintf("%s-key", ai_provider_local.ProviderLocal),
Description: "auto generate key",
Resource: "ai-key",
Version: time.Now().Format("20060102150405"),
MatchLabels: map[string]string{
"module": "ai-key",
},
},
Attr: map[string]interface{}{
"expired": 0,
"config": fmt.Sprintf("{\"base\":\"%s\"}", v),
"provider": provider,
"priority": 1,
"disabled": true,
},
})
return releases, nil
}
+6 -2
View File
@@ -6,6 +6,7 @@ import (
"fmt"
"net/http"
"sort"
"strings"
"time"
ai_model "github.com/APIParkLab/APIPark/service/ai-model"
@@ -200,6 +201,10 @@ func (i *imlProviderModule) Delete(ctx context.Context, id string) error {
}
func (i *imlProviderModule) AddProvider(ctx context.Context, input *ai_dto.NewProvider) (*ai_dto.SimpleProvider, error) {
_, has := model_runtime.GetProvider(strings.ToLower(input.Name))
if has {
return nil, fmt.Errorf("provider `%s` duplicate", input.Name)
}
// uuid = name
if has := i.providerService.CheckUuidDuplicate(ctx, input.Name); has {
return nil, fmt.Errorf("provider `%s` duplicate", input.Name)
@@ -241,7 +246,7 @@ func (i *imlProviderModule) SimpleProvider(ctx context.Context, id string) (*ai_
func (i *imlProviderModule) ConfiguredProviders(ctx context.Context, keyword string) ([]*ai_dto.ConfiguredProviderItem, error) {
// 获取已配置的AI服务商
list, err := i.providerService.Search(ctx, keyword, nil, "update_at")
list, err := i.providerService.Search(ctx, keyword, nil, "update_at desc")
if err != nil {
return nil, fmt.Errorf("get provider list error:%v", err)
}
@@ -694,7 +699,6 @@ func (i *imlProviderModule) UpdateProviderConfig(ctx context.Context, id string,
}, newKey(defaultKey),
}, true)
return nil
})
}
+2 -2
View File
@@ -596,9 +596,9 @@ func (i *imlMonitorStatisticModule) TopAPIStatistics(ctx context.Context, limit
} else {
statisticItem.IsRed = true
if key == "-" {
statisticItem.Name = "API"
statisticItem.Name = "Unknown API"
} else {
statisticItem.Name = fmt.Sprintf("未知API-%s", key)
statisticItem.Name = fmt.Sprintf("Unknow-%s", key)
}
}
result = append(result, statisticItem)
+28 -7
View File
@@ -396,15 +396,36 @@ func (i *imlServiceModule) Create(ctx context.Context, teamID string, input *ser
}
}
}
err := i.serviceModelMappingService.Save(ctx, &service_model_mapping.Save{
Sid: input.Id,
Content: input.ModelMapping,
})
err := i.serviceService.Create(ctx, mo)
if err != nil {
return err
}
return i.serviceService.Create(ctx, mo)
if input.ModelMapping != "" {
m := make(map[string]string)
err = json.Unmarshal([]byte(input.ModelMapping), &m)
if err != nil {
return err
}
err = i.serviceModelMappingService.Save(ctx, &service_model_mapping.Save{
Sid: input.Id,
Content: input.ModelMapping,
})
if err != nil {
return err
}
client, err := i.clusterService.GatewayClient(ctx, cluster.DefaultClusterID)
if err != nil {
return err
}
err = client.Hash().Online(ctx, &gateway.HashRelease{
HashKey: fmt.Sprintf("%s:%s", gateway.KeyServiceMapping, input.Id),
HashMap: m,
})
if err != nil {
return err
}
}
return nil
})
if err != nil {
return nil, err
@@ -473,7 +494,7 @@ func (i *imlServiceModule) Edit(ctx context.Context, id string, input *service_d
}
}
if input.ModelMapping != nil {
if input.ModelMapping != nil && *input.ModelMapping != "" {
m := make(map[string]string)
err = json.Unmarshal([]byte(*input.ModelMapping), &m)
if err != nil {
+1
View File
@@ -76,6 +76,7 @@ func FromEntity(e *api.AiAPIInfo) *API {
Updater: e.Updater,
Disable: e.Disable,
UseToken: e.UseToken,
Provider: e.Provider,
Type: e.Type,
AdditionalConfig: cfg,
}
+1 -1
View File
@@ -21,7 +21,7 @@ type imlLocalModelService struct {
}
func (i *imlLocalModelService) UpdateProvider(ctx context.Context, provider string, ids ...string) error {
_, err := i.store.UpdateWhere(ctx, map[string]interface{}{"provider": provider}, map[string]interface{}{"uuid": ids})
_, err := i.store.UpdateField(ctx, "provider", provider, "uuid in (?)", ids)
return err
}
+2 -2
View File
@@ -138,7 +138,8 @@ type LocalModelPackage struct {
Name string `gorm:"type:varchar(100);not null;column:name;comment:名称"`
Size string `gorm:"type:varchar(100);not null;column:size;comment:模型大小"`
Hash string `gorm:"type:varchar(100);not null;column:hash;comment:模型hash"`
Description string `gorm:"type:varchar(255);not null;column:description;comment:描述"`
Description string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;not null;column:description;comment:描述"`
Text string `gorm:"type:varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;not null;column:text;comment:描述"`
Version string `gorm:"type:varchar(100);not null;column:version;comment:版本"`
IsPopular bool `gorm:"type:tinyint(1);not null;column:is_popular;comment:是否热门"`
}
@@ -187,4 +188,3 @@ func (i *ProviderModel) TableName() string {
func (i *ProviderModel) IdValue() int64 {
return i.Id
}