@xopcai/xopcbot 0.1.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/README.md +6 -6
  2. package/README.zh-CN.md +6 -6
  3. package/dist/agent/__tests__/media-processing.test.d.ts +6 -0
  4. package/dist/agent/__tests__/media-processing.test.js +385 -0
  5. package/dist/agent/__tests__/media-processing.test.js.map +1 -0
  6. package/dist/agent/fallback/__tests__/index.test.js +16 -5
  7. package/dist/agent/fallback/__tests__/index.test.js.map +1 -1
  8. package/dist/agent/fallback/candidates.d.ts +2 -4
  9. package/dist/agent/fallback/candidates.js +19 -26
  10. package/dist/agent/fallback/candidates.js.map +1 -1
  11. package/dist/agent/helpers.d.ts +1 -0
  12. package/dist/agent/helpers.js.map +1 -1
  13. package/dist/agent/index.d.ts +6 -1
  14. package/dist/agent/index.js +10 -1
  15. package/dist/agent/index.js.map +1 -1
  16. package/dist/agent/models/compat.d.ts +35 -0
  17. package/dist/agent/models/compat.js +110 -0
  18. package/dist/agent/models/compat.js.map +1 -0
  19. package/dist/agent/models/fallback.d.ts +38 -0
  20. package/dist/agent/models/fallback.js +133 -0
  21. package/dist/agent/models/fallback.js.map +1 -0
  22. package/dist/agent/models/index.d.ts +10 -0
  23. package/dist/agent/models/index.js +11 -0
  24. package/dist/agent/models/index.js.map +1 -0
  25. package/dist/agent/{model-manager.d.ts → models/manager.d.ts} +2 -8
  26. package/dist/agent/{model-manager.js → models/manager.js} +38 -24
  27. package/dist/agent/models/manager.js.map +1 -0
  28. package/dist/agent/models/scan.d.ts +46 -0
  29. package/dist/agent/models/scan.js +177 -0
  30. package/dist/agent/models/scan.js.map +1 -0
  31. package/dist/agent/models/selection.d.ts +44 -0
  32. package/dist/agent/models/selection.js +141 -0
  33. package/dist/agent/models/selection.js.map +1 -0
  34. package/dist/agent/prompt/index.js +1 -1
  35. package/dist/agent/prompt/index.js.map +1 -1
  36. package/dist/agent/service.js +34 -16
  37. package/dist/agent/service.js.map +1 -1
  38. package/dist/agent/skills/__tests__/test-framework.test.js +15 -7
  39. package/dist/agent/skills/__tests__/test-framework.test.js.map +1 -1
  40. package/dist/agent/skills/config.d.ts +1 -1
  41. package/dist/agent/skills/config.js +2 -2
  42. package/dist/agent/skills/config.js.map +1 -1
  43. package/dist/agent/skills/index.js +15 -28
  44. package/dist/agent/skills/index.js.map +1 -1
  45. package/dist/agent/skills/installer.d.ts +1 -1
  46. package/dist/agent/skills/installer.js +1 -1
  47. package/dist/agent/skills/scanner.d.ts +1 -1
  48. package/dist/agent/skills/scanner.js +1 -1
  49. package/dist/agent/skills/test-framework.js +21 -20
  50. package/dist/agent/skills/test-framework.js.map +1 -1
  51. package/dist/agent/skills/types.d.ts +3 -3
  52. package/dist/agent/skills/types.js +1 -1
  53. package/dist/agent/skills/watcher.d.ts +1 -1
  54. package/dist/agent/skills/watcher.js +1 -1
  55. package/dist/agent/system-prompt.d.ts +67 -0
  56. package/dist/agent/system-prompt.js +351 -0
  57. package/dist/agent/system-prompt.js.map +1 -0
  58. package/dist/agent/tools/__tests__/send-media.test.d.ts +6 -0
  59. package/dist/agent/tools/__tests__/send-media.test.js +251 -0
  60. package/dist/agent/tools/__tests__/send-media.test.js.map +1 -0
  61. package/dist/agent/types.agent-defaults.d.ts +48 -0
  62. package/dist/agent/types.agent-defaults.js +5 -0
  63. package/dist/agent/types.agent-defaults.js.map +1 -0
  64. package/dist/agent/types.d.ts +14 -6
  65. package/dist/agent/types.js +5 -0
  66. package/dist/agent/types.js.map +1 -1
  67. package/dist/agent/workspace.d.ts +94 -0
  68. package/dist/agent/workspace.js +625 -0
  69. package/dist/agent/workspace.js.map +1 -0
  70. package/dist/auth/index.js +1 -1
  71. package/dist/auth/index.js.map +1 -1
  72. package/dist/auth/oauth/index.d.ts +1 -0
  73. package/dist/auth/oauth/index.js +1 -0
  74. package/dist/auth/oauth/index.js.map +1 -1
  75. package/dist/auth/oauth/kimi.d.ts +2 -1
  76. package/dist/auth/oauth/kimi.js +51 -48
  77. package/dist/auth/oauth/kimi.js.map +1 -1
  78. package/dist/auth/oauth/minimax-cn.d.ts +12 -0
  79. package/dist/auth/oauth/minimax-cn.js +111 -0
  80. package/dist/auth/oauth/minimax-cn.js.map +1 -0
  81. package/dist/auth/oauth/qwen.d.ts +5 -0
  82. package/dist/auth/oauth/qwen.js +54 -84
  83. package/dist/auth/oauth/qwen.js.map +1 -1
  84. package/dist/auth/profiles/index.d.ts +0 -2
  85. package/dist/auth/profiles/index.js +0 -2
  86. package/dist/auth/profiles/index.js.map +1 -1
  87. package/dist/auth/storage.js +7 -1
  88. package/dist/auth/storage.js.map +1 -1
  89. package/dist/channels/__tests__/media-integration.test.d.ts +6 -0
  90. package/dist/channels/__tests__/media-integration.test.js +398 -0
  91. package/dist/channels/__tests__/media-integration.test.js.map +1 -0
  92. package/dist/channels/__tests__/media.test.d.ts +6 -0
  93. package/dist/channels/__tests__/media.test.js +251 -0
  94. package/dist/channels/__tests__/media.test.js.map +1 -0
  95. package/dist/channels/access-control.d.ts +1 -1
  96. package/dist/channels/access-control.js +1 -1
  97. package/dist/channels/draft-stream.d.ts +1 -1
  98. package/dist/channels/draft-stream.js +1 -1
  99. package/dist/channels/format.d.ts +1 -1
  100. package/dist/channels/format.js +1 -1
  101. package/dist/channels/telegram/command-handler.js +15 -48
  102. package/dist/channels/telegram/command-handler.js.map +1 -1
  103. package/dist/channels/telegram/plugin.js +3 -2
  104. package/dist/channels/telegram/plugin.js.map +1 -1
  105. package/dist/channels/telegram/webhook.d.ts +1 -1
  106. package/dist/channels/telegram/webhook.js +1 -1
  107. package/dist/channels/types.d.ts +1 -1
  108. package/dist/channels/types.js +1 -1
  109. package/dist/channels/update-offset-store.d.ts +1 -1
  110. package/dist/channels/update-offset-store.js +1 -1
  111. package/dist/cli/commands/auth.js +8 -23
  112. package/dist/cli/commands/auth.js.map +1 -1
  113. package/dist/cli/commands/gateway.js +9 -1
  114. package/dist/cli/commands/gateway.js.map +1 -1
  115. package/dist/cli/commands/models.js +35 -29
  116. package/dist/cli/commands/models.js.map +1 -1
  117. package/dist/cli/commands/onboard.js +73 -58
  118. package/dist/cli/commands/onboard.js.map +1 -1
  119. package/dist/cli/commands/skills.js +6 -6
  120. package/dist/cli/commands/skills.js.map +1 -1
  121. package/dist/cli/index.js +0 -0
  122. package/dist/cli/templates.d.ts +2 -0
  123. package/dist/cli/templates.js +1 -1
  124. package/dist/cli/templates.js.map +1 -1
  125. package/dist/config/defaults.d.ts +19 -0
  126. package/dist/config/defaults.js +168 -0
  127. package/dist/config/defaults.js.map +1 -0
  128. package/dist/config/index.d.ts +5 -0
  129. package/dist/config/index.js +4 -0
  130. package/dist/config/index.js.map +1 -1
  131. package/dist/config/integration.d.ts +12 -0
  132. package/dist/config/integration.js +14 -0
  133. package/dist/config/integration.js.map +1 -0
  134. package/dist/config/models-json.d.ts +454 -0
  135. package/dist/config/models-json.js +323 -0
  136. package/dist/config/models-json.js.map +1 -0
  137. package/dist/config/paths.d.ts +2 -0
  138. package/dist/config/paths.js +4 -0
  139. package/dist/config/paths.js.map +1 -1
  140. package/dist/config/reload.d.ts +1 -1
  141. package/dist/config/reload.js +3 -3
  142. package/dist/config/reload.js.map +1 -1
  143. package/dist/config/resolve-config-value.d.ts +36 -0
  144. package/dist/config/resolve-config-value.js +218 -0
  145. package/dist/config/resolve-config-value.js.map +1 -0
  146. package/dist/config/rules.js +3 -2
  147. package/dist/config/rules.js.map +1 -1
  148. package/dist/config/schema.d.ts +17 -884
  149. package/dist/config/schema.js +36 -312
  150. package/dist/config/schema.js.map +1 -1
  151. package/dist/config/types.models.d.ts +54 -0
  152. package/dist/config/types.models.js +2 -0
  153. package/dist/config/types.models.js.map +1 -0
  154. package/dist/cron/validation.d.ts +4 -4
  155. package/dist/gateway/hono/app.js +230 -78
  156. package/dist/gateway/hono/app.js.map +1 -1
  157. package/dist/gateway/hono/oauth-async.d.ts +14 -0
  158. package/dist/gateway/hono/oauth-async.js +285 -0
  159. package/dist/gateway/hono/oauth-async.js.map +1 -0
  160. package/dist/gateway/hono/oauth.d.ts +9 -0
  161. package/dist/gateway/hono/oauth.js +157 -0
  162. package/dist/gateway/hono/oauth.js.map +1 -0
  163. package/dist/gateway/hono/sse.js +5 -2
  164. package/dist/gateway/hono/sse.js.map +1 -1
  165. package/dist/gateway/service.d.ts +6 -2
  166. package/dist/gateway/service.js +20 -6
  167. package/dist/gateway/service.js.map +1 -1
  168. package/dist/gateway/static/root/assets/flow-BqIEBwW6.js +2 -0
  169. package/dist/gateway/static/root/assets/flow-BqIEBwW6.js.map +1 -0
  170. package/dist/gateway/static/root/assets/main-Br2tw-87.js +5168 -0
  171. package/dist/gateway/static/root/assets/main-Br2tw-87.js.map +1 -0
  172. package/dist/gateway/static/root/assets/main-DwlbPf8Z.css +1 -0
  173. package/dist/gateway/static/root/index.html +2 -2
  174. package/dist/plugins/index.d.ts +0 -2
  175. package/dist/plugins/index.js +0 -2
  176. package/dist/plugins/index.js.map +1 -1
  177. package/dist/plugins/types.d.ts +0 -2
  178. package/dist/plugins/types.js +0 -2
  179. package/dist/plugins/types.js.map +1 -1
  180. package/dist/providers/index.d.ts +50 -22
  181. package/dist/providers/index.js +276 -50
  182. package/dist/providers/index.js.map +1 -1
  183. package/dist/providers/model-registry.d.ts +84 -0
  184. package/dist/providers/model-registry.js +385 -0
  185. package/dist/providers/model-registry.js.map +1 -0
  186. package/dist/types/providers.d.ts +2 -63
  187. package/dist/types/providers.js +1 -1
  188. package/dist/utils/__tests__/frontmatter.test.js +4 -3
  189. package/dist/utils/__tests__/frontmatter.test.js.map +1 -1
  190. package/dist/utils/diagnostic-events.d.ts +230 -0
  191. package/dist/utils/diagnostic-events.js +189 -0
  192. package/dist/utils/diagnostic-events.js.map +1 -0
  193. package/dist/utils/frontmatter.d.ts +0 -1
  194. package/dist/utils/frontmatter.js +13 -77
  195. package/dist/utils/frontmatter.js.map +1 -1
  196. package/dist/utils/log-stream.d.ts +95 -0
  197. package/dist/utils/log-stream.js +229 -0
  198. package/dist/utils/log-stream.js.map +1 -0
  199. package/dist/utils/logger.d.ts +5 -0
  200. package/dist/utils/logger.js +25 -0
  201. package/dist/utils/logger.js.map +1 -1
  202. package/dist/utils/redact.d.ts +73 -0
  203. package/dist/utils/redact.js +245 -0
  204. package/dist/utils/redact.js.map +1 -0
  205. package/package.json +6 -4
  206. package/skills/find-skills/SKILL.md +0 -9
  207. package/dist/__tests__/core.test.d.ts +0 -1
  208. package/dist/__tests__/core.test.js +0 -72
  209. package/dist/__tests__/core.test.js.map +0 -1
  210. package/dist/agent/model-manager.js.map +0 -1
  211. package/dist/cli/commands/configure.d.ts +0 -1
  212. package/dist/cli/commands/configure.js +0 -171
  213. package/dist/cli/commands/configure.js.map +0 -1
  214. package/dist/cli/commands/gateway-daemon.d.ts +0 -1
  215. package/dist/cli/commands/gateway-daemon.js +0 -141
  216. package/dist/cli/commands/gateway-daemon.js.map +0 -1
  217. package/dist/config/__tests__/diff.test.d.ts +0 -1
  218. package/dist/config/__tests__/diff.test.js +0 -192
  219. package/dist/config/__tests__/diff.test.js.map +0 -1
  220. package/dist/config/__tests__/loader.test.d.ts +0 -1
  221. package/dist/config/__tests__/loader.test.js +0 -356
  222. package/dist/config/__tests__/loader.test.js.map +0 -1
  223. package/dist/config/__tests__/paths.test.d.ts +0 -1
  224. package/dist/config/__tests__/paths.test.js +0 -192
  225. package/dist/config/__tests__/paths.test.js.map +0 -1
  226. package/dist/config/__tests__/reload.test.d.ts +0 -1
  227. package/dist/config/__tests__/reload.test.js +0 -374
  228. package/dist/config/__tests__/reload.test.js.map +0 -1
  229. package/dist/config/__tests__/rules.test.d.ts +0 -1
  230. package/dist/config/__tests__/rules.test.js +0 -204
  231. package/dist/config/__tests__/rules.test.js.map +0 -1
  232. package/dist/config/__tests__/schema.test.d.ts +0 -1
  233. package/dist/config/__tests__/schema.test.js +0 -672
  234. package/dist/config/__tests__/schema.test.js.map +0 -1
  235. package/dist/daemon/background-start.d.ts +0 -33
  236. package/dist/daemon/background-start.js +0 -89
  237. package/dist/daemon/background-start.js.map +0 -1
  238. package/dist/daemon/gateway-manager.d.ts +0 -87
  239. package/dist/daemon/gateway-manager.js +0 -324
  240. package/dist/daemon/gateway-manager.js.map +0 -1
  241. package/dist/daemon/index.d.ts +0 -5
  242. package/dist/daemon/index.js +0 -6
  243. package/dist/daemon/index.js.map +0 -1
  244. package/dist/gateway/static/root/assets/main-DevbZW9K.js +0 -2227
  245. package/dist/gateway/static/root/assets/main-DevbZW9K.js.map +0 -1
  246. package/dist/gateway/static/root/assets/main-DxZg1Nmz.css +0 -1
  247. package/dist/providers/__tests__/registry.test.d.ts +0 -1
  248. package/dist/providers/__tests__/registry.test.js +0 -110
  249. package/dist/providers/__tests__/registry.test.js.map +0 -1
  250. package/dist/providers/api-strategies.d.ts +0 -15
  251. package/dist/providers/api-strategies.js +0 -96
  252. package/dist/providers/api-strategies.js.map +0 -1
  253. package/dist/providers/auto-discovery.d.ts +0 -39
  254. package/dist/providers/auto-discovery.js +0 -189
  255. package/dist/providers/auto-discovery.js.map +0 -1
  256. package/dist/providers/config.d.ts +0 -25
  257. package/dist/providers/config.js +0 -42
  258. package/dist/providers/config.js.map +0 -1
  259. package/dist/providers/model-catalog.d.ts +0 -92
  260. package/dist/providers/model-catalog.js +0 -998
  261. package/dist/providers/model-catalog.js.map +0 -1
  262. package/dist/providers/models-dev-data.d.ts +0 -11
  263. package/dist/providers/models-dev-data.js +0 -1035
  264. package/dist/providers/models-dev-data.js.map +0 -1
  265. package/dist/providers/models-dev.d.ts +0 -34
  266. package/dist/providers/models-dev.js +0 -33
  267. package/dist/providers/models-dev.js.map +0 -1
  268. package/dist/providers/pi-ai.d.ts +0 -62
  269. package/dist/providers/pi-ai.js +0 -221
  270. package/dist/providers/pi-ai.js.map +0 -1
  271. package/dist/providers/provider-catalog.d.ts +0 -91
  272. package/dist/providers/provider-catalog.js +0 -791
  273. package/dist/providers/provider-catalog.js.map +0 -1
  274. package/dist/providers/registry.d.ts +0 -135
  275. package/dist/providers/registry.js +0 -475
  276. package/dist/providers/registry.js.map +0 -1
  277. package/dist/providers/types.d.ts +0 -95
  278. package/dist/providers/types.js +0 -7
  279. package/dist/providers/types.js.map +0 -1
  280. package/dist/session/chat-manager.d.ts +0 -49
  281. package/dist/session/chat-manager.js +0 -167
  282. package/dist/session/chat-manager.js.map +0 -1
  283. package/dist/session/chat-types.d.ts +0 -53
  284. package/dist/session/chat-types.js +0 -63
  285. package/dist/session/chat-types.js.map +0 -1
@@ -1,998 +0,0 @@
1
- export const MODEL_CATALOG = [
2
- // ============================================
3
- // OpenAI Models
4
- // ============================================
5
- {
6
- id: 'gpt-4o',
7
- name: 'GPT-4o',
8
- provider: 'openai',
9
- description: 'OpenAI 旗舰多模态模型,性能与效率平衡',
10
- family: 'GPT-4',
11
- inputModalities: ['text', 'image'],
12
- outputModalities: ['text'],
13
- features: {
14
- streaming: true,
15
- functionCalling: true,
16
- jsonMode: true,
17
- reasoning: false,
18
- systemPrompt: true,
19
- tools: true,
20
- vision: true,
21
- documentUnderstanding: false,
22
- codeExecution: false,
23
- imageGeneration: false,
24
- audioUnderstanding: false,
25
- videoUnderstanding: false,
26
- },
27
- limits: {
28
- contextWindow: 128000,
29
- maxOutputTokens: 4096,
30
- maxFileSize: 20,
31
- maxImagesPerRequest: 10,
32
- supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
33
- },
34
- pricing: { inputPer1k: 0.0025, outputPer1k: 0.01 },
35
- performance: {
36
- qualityScore: 9,
37
- speedScore: 8,
38
- recommendedFor: ['general', 'vision', 'coding', 'analysis'],
39
- },
40
- recommended: true,
41
- },
42
- {
43
- id: 'gpt-4o-mini',
44
- name: 'GPT-4o Mini',
45
- provider: 'openai',
46
- description: '轻量级多模态模型,成本效益高',
47
- family: 'GPT-4',
48
- inputModalities: ['text', 'image'],
49
- outputModalities: ['text'],
50
- features: {
51
- streaming: true,
52
- functionCalling: true,
53
- jsonMode: true,
54
- reasoning: false,
55
- systemPrompt: true,
56
- tools: true,
57
- vision: true,
58
- documentUnderstanding: false,
59
- codeExecution: false,
60
- imageGeneration: false,
61
- audioUnderstanding: false,
62
- videoUnderstanding: false,
63
- },
64
- limits: {
65
- contextWindow: 128000,
66
- maxOutputTokens: 4096,
67
- maxFileSize: 20,
68
- maxImagesPerRequest: 10,
69
- supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
70
- },
71
- pricing: { inputPer1k: 0.00015, outputPer1k: 0.0006 },
72
- performance: {
73
- qualityScore: 7,
74
- speedScore: 9,
75
- recommendedFor: ['fast', 'cheap', 'simple'],
76
- },
77
- recommended: true,
78
- },
79
- {
80
- id: 'gpt-5',
81
- name: 'GPT-5',
82
- provider: 'openai',
83
- description: 'OpenAI 最新旗舰模型',
84
- family: 'GPT-5',
85
- inputModalities: ['text', 'image', 'audio'],
86
- outputModalities: ['text', 'audio'],
87
- features: {
88
- streaming: true,
89
- functionCalling: true,
90
- jsonMode: true,
91
- reasoning: true,
92
- systemPrompt: true,
93
- tools: true,
94
- vision: true,
95
- documentUnderstanding: true,
96
- codeExecution: false,
97
- imageGeneration: false,
98
- audioUnderstanding: true,
99
- videoUnderstanding: false,
100
- },
101
- limits: {
102
- contextWindow: 256000,
103
- maxOutputTokens: 16384,
104
- maxFileSize: 50,
105
- },
106
- pricing: { inputPer1k: 0.01, outputPer1k: 0.03 },
107
- performance: {
108
- qualityScore: 10,
109
- speedScore: 7,
110
- recommendedFor: ['complex', 'reasoning', 'analysis', 'creative'],
111
- },
112
- recommended: true,
113
- },
114
- {
115
- id: 'o1',
116
- name: 'o1',
117
- provider: 'openai',
118
- description: 'OpenAI 推理模型,适合复杂任务',
119
- family: 'o1',
120
- inputModalities: ['text'],
121
- outputModalities: ['text'],
122
- features: {
123
- streaming: false, // o1 does not support streaming
124
- functionCalling: true,
125
- jsonMode: true,
126
- reasoning: true,
127
- systemPrompt: false, // o1 does not support system prompt
128
- tools: true,
129
- vision: false,
130
- documentUnderstanding: false,
131
- codeExecution: false,
132
- imageGeneration: false,
133
- audioUnderstanding: false,
134
- videoUnderstanding: false,
135
- },
136
- limits: {
137
- contextWindow: 200000,
138
- maxOutputTokens: 100000,
139
- },
140
- pricing: { inputPer1k: 0.015, outputPer1k: 0.06 },
141
- performance: {
142
- qualityScore: 10,
143
- speedScore: 5,
144
- recommendedFor: ['math', 'science', 'coding', 'complex-reasoning'],
145
- },
146
- },
147
- {
148
- id: 'o3-mini',
149
- name: 'o3 Mini',
150
- provider: 'openai',
151
- description: '轻量级推理模型',
152
- family: 'o3',
153
- inputModalities: ['text'],
154
- outputModalities: ['text'],
155
- features: {
156
- streaming: false,
157
- functionCalling: true,
158
- jsonMode: true,
159
- reasoning: true,
160
- systemPrompt: false,
161
- tools: true,
162
- vision: false,
163
- documentUnderstanding: false,
164
- codeExecution: false,
165
- imageGeneration: false,
166
- audioUnderstanding: false,
167
- videoUnderstanding: false,
168
- },
169
- limits: {
170
- contextWindow: 200000,
171
- maxOutputTokens: 100000,
172
- },
173
- pricing: { inputPer1k: 0.0011, outputPer1k: 0.0044 },
174
- performance: {
175
- qualityScore: 9,
176
- speedScore: 6,
177
- recommendedFor: ['reasoning', 'math', 'coding'],
178
- },
179
- },
180
- // ============================================
181
- // Anthropic Models
182
- // ============================================
183
- {
184
- id: 'claude-sonnet-4-5',
185
- name: 'Claude Sonnet 4.5',
186
- provider: 'anthropic',
187
- description: 'Anthropic 平衡型模型,速度快性能好',
188
- family: 'Claude 4.5',
189
- inputModalities: ['text', 'image', 'pdf'],
190
- outputModalities: ['text'],
191
- features: {
192
- streaming: true,
193
- functionCalling: true,
194
- jsonMode: false,
195
- reasoning: false,
196
- systemPrompt: true,
197
- tools: true,
198
- vision: true,
199
- documentUnderstanding: true,
200
- codeExecution: false,
201
- imageGeneration: false,
202
- audioUnderstanding: false,
203
- videoUnderstanding: false,
204
- },
205
- limits: {
206
- contextWindow: 200000,
207
- maxOutputTokens: 8192,
208
- maxFileSize: 32,
209
- maxImagesPerRequest: 20,
210
- supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif'],
211
- supportedDocumentTypes: ['application/pdf'],
212
- },
213
- pricing: { inputPer1k: 0.003, outputPer1k: 0.015, cacheReadDiscount: 0.1 },
214
- performance: {
215
- qualityScore: 9,
216
- speedScore: 9,
217
- recommendedFor: ['general', 'coding', 'analysis', 'document'],
218
- },
219
- recommended: true,
220
- },
221
- {
222
- id: 'claude-opus-4-5',
223
- name: 'Claude Opus 4.5',
224
- provider: 'anthropic',
225
- description: 'Anthropic 最强模型,适合复杂任务',
226
- family: 'Claude 4.5',
227
- inputModalities: ['text', 'image', 'pdf'],
228
- outputModalities: ['text'],
229
- features: {
230
- streaming: true,
231
- functionCalling: true,
232
- jsonMode: false,
233
- reasoning: true,
234
- systemPrompt: true,
235
- tools: true,
236
- vision: true,
237
- documentUnderstanding: true,
238
- codeExecution: false,
239
- imageGeneration: false,
240
- audioUnderstanding: false,
241
- videoUnderstanding: false,
242
- },
243
- limits: {
244
- contextWindow: 200000,
245
- maxOutputTokens: 8192,
246
- maxFileSize: 32,
247
- maxImagesPerRequest: 20,
248
- },
249
- pricing: { inputPer1k: 0.015, outputPer1k: 0.075, cacheReadDiscount: 0.1 },
250
- performance: {
251
- qualityScore: 10,
252
- speedScore: 7,
253
- recommendedFor: ['complex', 'analysis', 'creative', 'research'],
254
- },
255
- },
256
- {
257
- id: 'claude-haiku-4-5',
258
- name: 'Claude Haiku 4.5',
259
- provider: 'anthropic',
260
- description: 'Anthropic 轻量级模型,速度极快',
261
- family: 'Claude 4.5',
262
- inputModalities: ['text', 'image'],
263
- outputModalities: ['text'],
264
- features: {
265
- streaming: true,
266
- functionCalling: true,
267
- jsonMode: false,
268
- reasoning: false,
269
- systemPrompt: true,
270
- tools: true,
271
- vision: true,
272
- documentUnderstanding: false,
273
- codeExecution: false,
274
- imageGeneration: false,
275
- audioUnderstanding: false,
276
- videoUnderstanding: false,
277
- },
278
- limits: {
279
- contextWindow: 200000,
280
- maxOutputTokens: 4096,
281
- },
282
- pricing: { inputPer1k: 0.00025, outputPer1k: 0.00125, cacheReadDiscount: 0.1 },
283
- performance: {
284
- qualityScore: 7,
285
- speedScore: 10,
286
- recommendedFor: ['fast', 'cheap', 'simple', 'summarization'],
287
- },
288
- },
289
- // ============================================
290
- // Google Gemini Models
291
- // ============================================
292
- {
293
- id: 'gemini-2.5-pro',
294
- name: 'Gemini 2.5 Pro',
295
- provider: 'google',
296
- description: 'Google 最强多模态模型,支持视频',
297
- family: 'Gemini 2.5',
298
- inputModalities: ['text', 'image', 'video', 'audio', 'pdf'],
299
- outputModalities: ['text'],
300
- features: {
301
- streaming: true,
302
- functionCalling: true,
303
- jsonMode: true,
304
- reasoning: true,
305
- systemPrompt: true,
306
- tools: true,
307
- vision: true,
308
- documentUnderstanding: true,
309
- codeExecution: true,
310
- imageGeneration: false,
311
- audioUnderstanding: true,
312
- videoUnderstanding: true,
313
- },
314
- limits: {
315
- contextWindow: 1000000, // 1M context!
316
- maxOutputTokens: 8192,
317
- maxFileSize: 20,
318
- maxImagesPerRequest: 100,
319
- supportedImageTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/heic', 'image/heif'],
320
- supportedVideoTypes: ['video/mp4', 'video/mpeg', 'video/mov', 'video/avi', 'video/x-flv', 'video/mpg', 'video/webm', 'video/wmv', 'video/3gpp'],
321
- supportedAudioTypes: ['audio/wav', 'audio/mp3', 'audio/aiff', 'audio/aac', 'audio/ogg', 'audio/flac'],
322
- supportedDocumentTypes: ['application/pdf'],
323
- },
324
- pricing: { inputPer1k: 0.00125, outputPer1k: 0.01 },
325
- performance: {
326
- qualityScore: 9,
327
- speedScore: 8,
328
- recommendedFor: ['long-context', 'video', 'multimodal', 'document'],
329
- },
330
- recommended: true,
331
- },
332
- {
333
- id: 'gemini-2.5-flash',
334
- name: 'Gemini 2.5 Flash',
335
- provider: 'google',
336
- description: 'Google 快速多模态模型',
337
- family: 'Gemini 2.5',
338
- inputModalities: ['text', 'image', 'video', 'audio', 'pdf'],
339
- outputModalities: ['text'],
340
- features: {
341
- streaming: true,
342
- functionCalling: true,
343
- jsonMode: true,
344
- reasoning: true,
345
- systemPrompt: true,
346
- tools: true,
347
- vision: true,
348
- documentUnderstanding: true,
349
- codeExecution: true,
350
- imageGeneration: false,
351
- audioUnderstanding: true,
352
- videoUnderstanding: true,
353
- },
354
- limits: {
355
- contextWindow: 1000000,
356
- maxOutputTokens: 8192,
357
- },
358
- pricing: { inputPer1k: 0.000075, outputPer1k: 0.0003 },
359
- performance: {
360
- qualityScore: 8,
361
- speedScore: 9,
362
- recommendedFor: ['fast', 'cheap', 'multimodal', 'long-context'],
363
- },
364
- recommended: true,
365
- },
366
- {
367
- id: 'gemini-2.0-flash',
368
- name: 'Gemini 2.0 Flash',
369
- provider: 'google',
370
- description: 'Google 2.0 系列快速模型',
371
- family: 'Gemini 2.0',
372
- inputModalities: ['text', 'image', 'video', 'audio'],
373
- outputModalities: ['text'],
374
- features: {
375
- streaming: true,
376
- functionCalling: true,
377
- jsonMode: true,
378
- reasoning: false,
379
- systemPrompt: true,
380
- tools: true,
381
- vision: true,
382
- documentUnderstanding: false,
383
- codeExecution: false,
384
- imageGeneration: false,
385
- audioUnderstanding: true,
386
- videoUnderstanding: true,
387
- },
388
- limits: {
389
- contextWindow: 1000000,
390
- maxOutputTokens: 8192,
391
- },
392
- pricing: { inputPer1k: 0.0001, outputPer1k: 0.0004 },
393
- performance: {
394
- qualityScore: 8,
395
- speedScore: 10,
396
- recommendedFor: ['fast', 'cheap', 'multimodal'],
397
- },
398
- },
399
- // ============================================
400
- // Qwen
401
- // ============================================
402
- {
403
- id: 'qwen-plus',
404
- name: 'Qwen Plus',
405
- provider: 'qwen',
406
- description: '通义千问 Plus,综合能力强劲',
407
- family: 'Qwen',
408
- inputModalities: ['text', 'image'],
409
- outputModalities: ['text'],
410
- features: {
411
- streaming: true,
412
- functionCalling: true,
413
- jsonMode: true,
414
- reasoning: false,
415
- systemPrompt: true,
416
- tools: true,
417
- vision: true,
418
- documentUnderstanding: false,
419
- codeExecution: false,
420
- imageGeneration: false,
421
- audioUnderstanding: false,
422
- videoUnderstanding: false,
423
- },
424
- limits: {
425
- contextWindow: 131072,
426
- maxOutputTokens: 8192,
427
- maxImagesPerRequest: 10,
428
- },
429
- pricing: { inputPer1k: 0.0008, outputPer1k: 0.002 },
430
- recommended: true,
431
- },
432
- {
433
- id: 'qwen-max',
434
- name: 'Qwen Max',
435
- provider: 'qwen',
436
- description: '通义千问 Max,最强能力',
437
- family: 'Qwen',
438
- inputModalities: ['text', 'image'],
439
- outputModalities: ['text'],
440
- features: {
441
- streaming: true,
442
- functionCalling: true,
443
- jsonMode: true,
444
- reasoning: true,
445
- systemPrompt: true,
446
- tools: true,
447
- vision: true,
448
- documentUnderstanding: false,
449
- codeExecution: false,
450
- imageGeneration: false,
451
- audioUnderstanding: false,
452
- videoUnderstanding: false,
453
- },
454
- limits: {
455
- contextWindow: 32768,
456
- maxOutputTokens: 8192,
457
- },
458
- pricing: { inputPer1k: 0.002, outputPer1k: 0.006 },
459
- recommended: true,
460
- },
461
- {
462
- id: 'qwen3-235b',
463
- name: 'Qwen3 235B',
464
- provider: 'qwen',
465
- description: 'Qwen3 235B 参数模型',
466
- family: 'Qwen3',
467
- inputModalities: ['text'],
468
- outputModalities: ['text'],
469
- features: {
470
- streaming: true,
471
- functionCalling: true,
472
- jsonMode: true,
473
- reasoning: true,
474
- systemPrompt: true,
475
- tools: true,
476
- vision: false,
477
- documentUnderstanding: false,
478
- codeExecution: false,
479
- imageGeneration: false,
480
- audioUnderstanding: false,
481
- videoUnderstanding: false,
482
- },
483
- limits: {
484
- contextWindow: 128000,
485
- maxOutputTokens: 8192,
486
- },
487
- pricing: { inputPer1k: 0.001, outputPer1k: 0.003 },
488
- },
489
- // ============================================
490
- // Kimi
491
- // ============================================
492
- {
493
- id: 'kimi-k2.5',
494
- name: 'Kimi K2.5',
495
- provider: 'kimi',
496
- description: 'Kimi K2.5,长上下文专家',
497
- family: 'Kimi',
498
- inputModalities: ['text'],
499
- outputModalities: ['text'],
500
- features: {
501
- streaming: true,
502
- functionCalling: true,
503
- jsonMode: true,
504
- reasoning: false,
505
- systemPrompt: true,
506
- tools: true,
507
- vision: false,
508
- documentUnderstanding: true,
509
- codeExecution: false,
510
- imageGeneration: false,
511
- audioUnderstanding: false,
512
- videoUnderstanding: false,
513
- },
514
- limits: {
515
- contextWindow: 256000,
516
- maxOutputTokens: 4096,
517
- },
518
- pricing: { inputPer1k: 0.002, outputPer1k: 0.006 },
519
- performance: {
520
- qualityScore: 9,
521
- speedScore: 8,
522
- recommendedFor: ['long-context', 'document', 'coding'],
523
- },
524
- recommended: true,
525
- },
526
- {
527
- id: 'kimi-k2-thinking',
528
- name: 'Kimi K2 Thinking',
529
- provider: 'kimi',
530
- description: 'Kimi K2 推理版',
531
- family: 'Kimi',
532
- inputModalities: ['text'],
533
- outputModalities: ['text'],
534
- features: {
535
- streaming: true,
536
- functionCalling: true,
537
- jsonMode: true,
538
- reasoning: true,
539
- systemPrompt: true,
540
- tools: true,
541
- vision: false,
542
- documentUnderstanding: true,
543
- codeExecution: false,
544
- imageGeneration: false,
545
- audioUnderstanding: false,
546
- videoUnderstanding: false,
547
- },
548
- limits: {
549
- contextWindow: 256000,
550
- maxOutputTokens: 4096,
551
- },
552
- pricing: { inputPer1k: 0.002, outputPer1k: 0.006 },
553
- },
554
- // ============================================
555
- // MiniMax
556
- // ============================================
557
- {
558
- id: 'minimax-m2.5',
559
- name: 'MiniMax M2.5',
560
- provider: 'minimax',
561
- description: 'MiniMax M2.5',
562
- family: 'MiniMax',
563
- inputModalities: ['text'],
564
- outputModalities: ['text'],
565
- features: {
566
- streaming: true,
567
- functionCalling: true,
568
- jsonMode: true,
569
- reasoning: false,
570
- systemPrompt: true,
571
- tools: true,
572
- vision: false,
573
- documentUnderstanding: false,
574
- codeExecution: false,
575
- imageGeneration: false,
576
- audioUnderstanding: false,
577
- videoUnderstanding: false,
578
- },
579
- limits: {
580
- contextWindow: 1000000,
581
- maxOutputTokens: 4096,
582
- },
583
- recommended: true,
584
- },
585
- {
586
- id: 'minimax-m2.1',
587
- name: 'MiniMax M2.1',
588
- provider: 'minimax',
589
- description: 'MiniMax M2.1',
590
- family: 'MiniMax',
591
- inputModalities: ['text'],
592
- outputModalities: ['text'],
593
- features: {
594
- streaming: true,
595
- functionCalling: true,
596
- jsonMode: true,
597
- reasoning: false,
598
- systemPrompt: true,
599
- tools: true,
600
- vision: false,
601
- documentUnderstanding: false,
602
- codeExecution: false,
603
- imageGeneration: false,
604
- audioUnderstanding: false,
605
- videoUnderstanding: false,
606
- },
607
- limits: {
608
- contextWindow: 1000000,
609
- maxOutputTokens: 4096,
610
- },
611
- },
612
- // ============================================
613
- // Zhipu
614
- // ============================================
615
- {
616
- id: 'glm-4',
617
- name: 'GLM-4',
618
- provider: 'zhipu',
619
- description: '智谱 GLM-4',
620
- family: 'GLM-4',
621
- inputModalities: ['text', 'image'],
622
- outputModalities: ['text'],
623
- features: {
624
- streaming: true,
625
- functionCalling: true,
626
- jsonMode: true,
627
- reasoning: false,
628
- systemPrompt: true,
629
- tools: true,
630
- vision: true,
631
- documentUnderstanding: false,
632
- codeExecution: false,
633
- imageGeneration: false,
634
- audioUnderstanding: false,
635
- videoUnderstanding: false,
636
- },
637
- limits: {
638
- contextWindow: 128000,
639
- maxOutputTokens: 4096,
640
- },
641
- recommended: true,
642
- },
643
- {
644
- id: 'glm-4v-flash',
645
- name: 'GLM-4V Flash',
646
- provider: 'zhipu',
647
- description: 'GLM-4V Flash,视觉版',
648
- family: 'GLM-4',
649
- inputModalities: ['text', 'image'],
650
- outputModalities: ['text'],
651
- features: {
652
- streaming: true,
653
- functionCalling: true,
654
- jsonMode: true,
655
- reasoning: false,
656
- systemPrompt: true,
657
- tools: true,
658
- vision: true,
659
- documentUnderstanding: false,
660
- codeExecution: false,
661
- imageGeneration: false,
662
- audioUnderstanding: false,
663
- videoUnderstanding: false,
664
- },
665
- limits: {
666
- contextWindow: 8192,
667
- maxOutputTokens: 4096,
668
- },
669
- },
670
- {
671
- id: 'glm-5',
672
- name: 'GLM-5',
673
- provider: 'zhipu',
674
- description: '智谱 GLM-5',
675
- family: 'GLM-5',
676
- inputModalities: ['text', 'image'],
677
- outputModalities: ['text'],
678
- features: {
679
- streaming: true,
680
- functionCalling: true,
681
- jsonMode: true,
682
- reasoning: true,
683
- systemPrompt: true,
684
- tools: true,
685
- vision: true,
686
- documentUnderstanding: false,
687
- codeExecution: false,
688
- imageGeneration: false,
689
- audioUnderstanding: false,
690
- videoUnderstanding: false,
691
- },
692
- limits: {
693
- contextWindow: 128000,
694
- maxOutputTokens: 8192,
695
- },
696
- },
697
- // ============================================
698
- // DeepSeek
699
- // ============================================
700
- {
701
- id: 'deepseek-chat',
702
- name: 'DeepSeek Chat',
703
- provider: 'deepseek',
704
- description: 'DeepSeek 对话模型',
705
- family: 'DeepSeek',
706
- inputModalities: ['text'],
707
- outputModalities: ['text'],
708
- features: {
709
- streaming: true,
710
- functionCalling: true,
711
- jsonMode: true,
712
- reasoning: false,
713
- systemPrompt: true,
714
- tools: true,
715
- vision: false,
716
- documentUnderstanding: false,
717
- codeExecution: false,
718
- imageGeneration: false,
719
- audioUnderstanding: false,
720
- videoUnderstanding: false,
721
- },
722
- limits: {
723
- contextWindow: 64000,
724
- maxOutputTokens: 8192,
725
- },
726
- pricing: { inputPer1k: 0.00014, outputPer1k: 0.00028 },
727
- recommended: true,
728
- },
729
- {
730
- id: 'deepseek-reasoner',
731
- name: 'DeepSeek Reasoner',
732
- provider: 'deepseek',
733
- description: 'DeepSeek 推理模型(R1)',
734
- family: 'DeepSeek',
735
- inputModalities: ['text'],
736
- outputModalities: ['text'],
737
- features: {
738
- streaming: true,
739
- functionCalling: false,
740
- jsonMode: true,
741
- reasoning: true,
742
- systemPrompt: true,
743
- tools: false,
744
- vision: false,
745
- documentUnderstanding: false,
746
- codeExecution: false,
747
- imageGeneration: false,
748
- audioUnderstanding: false,
749
- videoUnderstanding: false,
750
- },
751
- limits: {
752
- contextWindow: 64000,
753
- maxOutputTokens: 8192,
754
- },
755
- pricing: { inputPer1k: 0.00055, outputPer1k: 0.00219 },
756
- },
757
- {
758
- id: 'qwen3-max-2026-01-23',
759
- name: 'Qwen3 Max (Coding Plan)',
760
- provider: 'bailian',
761
- description: '阿里云百炼 Coding Plan qwen3-max-thinking',
762
- family: 'Qwen3',
763
- inputModalities: ['text'],
764
- outputModalities: ['text'],
765
- features: {
766
- streaming: true,
767
- functionCalling: true,
768
- jsonMode: true,
769
- reasoning: true,
770
- systemPrompt: true,
771
- tools: true,
772
- vision: false,
773
- documentUnderstanding: false,
774
- codeExecution: false,
775
- imageGeneration: false,
776
- audioUnderstanding: false,
777
- videoUnderstanding: false,
778
- },
779
- limits: {
780
- contextWindow: 262144,
781
- maxOutputTokens: 65536,
782
- },
783
- recommended: true,
784
- },
785
- {
786
- id: 'qwen3.5-plus',
787
- name: 'Qwen3.5 Plus (Coding Plan)',
788
- provider: 'bailian',
789
- description: '阿里云百炼 Coding Plan qwen3.5-plus',
790
- family: 'Qwen3.5',
791
- inputModalities: ['text'],
792
- outputModalities: ['text'],
793
- features: {
794
- streaming: true,
795
- functionCalling: true,
796
- jsonMode: true,
797
- reasoning: true,
798
- systemPrompt: true,
799
- tools: true,
800
- vision: false,
801
- documentUnderstanding: false,
802
- codeExecution: false,
803
- imageGeneration: false,
804
- audioUnderstanding: false,
805
- videoUnderstanding: false,
806
- },
807
- limits: {
808
- contextWindow: 131072,
809
- maxOutputTokens: 32768,
810
- },
811
- },
812
- // ============================================
813
- // Groq
814
- // ============================================
815
- {
816
- id: 'llama-3.3-70b',
817
- name: 'Llama 3.3 70B',
818
- provider: 'groq',
819
- description: 'Meta Llama 3.3 70B,极速推理',
820
- family: 'Llama',
821
- inputModalities: ['text'],
822
- outputModalities: ['text'],
823
- features: {
824
- streaming: true,
825
- functionCalling: true,
826
- jsonMode: true,
827
- reasoning: false,
828
- systemPrompt: true,
829
- tools: true,
830
- vision: false,
831
- documentUnderstanding: false,
832
- codeExecution: false,
833
- imageGeneration: false,
834
- audioUnderstanding: false,
835
- videoUnderstanding: false,
836
- },
837
- limits: {
838
- contextWindow: 128000,
839
- maxOutputTokens: 4096,
840
- },
841
- pricing: { inputPer1k: 0.00059, outputPer1k: 0.00079 },
842
- performance: {
843
- qualityScore: 8,
844
- speedScore: 10,
845
- recommendedFor: ['fast', 'cheap'],
846
- },
847
- recommended: true,
848
- },
849
- // ============================================
850
- // xAI
851
- // ============================================
852
- {
853
- id: 'grok-3',
854
- name: 'Grok 3',
855
- provider: 'xai',
856
- description: 'xAI Grok 3',
857
- family: 'Grok',
858
- inputModalities: ['text', 'image'],
859
- outputModalities: ['text'],
860
- features: {
861
- streaming: true,
862
- functionCalling: true,
863
- jsonMode: true,
864
- reasoning: true,
865
- systemPrompt: true,
866
- tools: true,
867
- vision: true,
868
- documentUnderstanding: false,
869
- codeExecution: false,
870
- imageGeneration: false,
871
- audioUnderstanding: false,
872
- videoUnderstanding: false,
873
- },
874
- limits: {
875
- contextWindow: 128000,
876
- maxOutputTokens: 4096,
877
- },
878
- },
879
- ];
880
- export function getAllModels() {
881
- return MODEL_CATALOG;
882
- }
883
- export function findModel(id) {
884
- return MODEL_CATALOG.find(m => m.id === id);
885
- }
886
- export function getModelsByProvider(providerId) {
887
- return MODEL_CATALOG.filter(m => m.provider === providerId);
888
- }
889
- export function findModelByProvider(providerId, modelId) {
890
- return MODEL_CATALOG.find(m => m.provider === providerId && m.id === modelId);
891
- }
892
- export function getRecommendedModels() {
893
- return MODEL_CATALOG.filter(m => m.recommended && !m.deprecated);
894
- }
895
- export function getModelsByCapability(capability) {
896
- return MODEL_CATALOG.filter(m => m.features[capability] && !m.deprecated);
897
- }
898
- export function getModelsByModality(modality) {
899
- return MODEL_CATALOG.filter(m => m.inputModalities.includes(modality) && !m.deprecated);
900
- }
901
- export function getVisionModels() {
902
- return getModelsByCapability('vision');
903
- }
904
- export function getFunctionCallingModels() {
905
- return getModelsByCapability('functionCalling');
906
- }
907
- export function getModelsForTask(task) {
908
- switch (task) {
909
- case 'vision':
910
- return getVisionModels().sort((a, b) => (b.performance?.qualityScore || 0) - (a.performance?.qualityScore || 0));
911
- case 'coding':
912
- return MODEL_CATALOG.filter(m => m.performance?.recommendedFor?.includes('coding') && !m.deprecated);
913
- case 'fast':
914
- return MODEL_CATALOG.filter(m => m.performance?.recommendedFor?.includes('fast') && !m.deprecated).sort((a, b) => (b.performance?.speedScore || 0) - (a.performance?.speedScore || 0));
915
- case 'cheap':
916
- return MODEL_CATALOG.filter(m => !m.deprecated)
917
- .sort((a, b) => (a.pricing?.inputPer1k || Infinity) - (b.pricing?.inputPer1k || Infinity));
918
- case 'long-context':
919
- return MODEL_CATALOG.filter(m => !m.deprecated)
920
- .sort((a, b) => b.limits.contextWindow - a.limits.contextWindow);
921
- case 'reasoning':
922
- return getModelsByCapability('reasoning');
923
- case 'multimodal':
924
- return MODEL_CATALOG.filter(m => m.inputModalities.length > 1 && !m.deprecated);
925
- case 'document':
926
- return MODEL_CATALOG.filter(m => (m.inputModalities.includes('pdf') || m.features.documentUnderstanding) && !m.deprecated);
927
- default:
928
- return getRecommendedModels();
929
- }
930
- }
931
- export function modelSupportsModality(modelId, modality) {
932
- const model = findModel(modelId);
933
- if (!model)
934
- return false;
935
- return model.inputModalities.includes(modality);
936
- }
937
- export function modelSupportsFeature(modelId, feature) {
938
- const model = findModel(modelId);
939
- if (!model)
940
- return false;
941
- return model.features[feature];
942
- }
943
- export function estimateCost(modelId, inputTokens, outputTokens) {
944
- const model = findModel(modelId);
945
- if (!model?.pricing)
946
- return undefined;
947
- const inputCost = (inputTokens / 1000) * model.pricing.inputPer1k;
948
- const outputCost = (outputTokens / 1000) * model.pricing.outputPer1k;
949
- return inputCost + outputCost;
950
- }
951
- export function getModelComparisonInfo() {
952
- return MODEL_CATALOG
953
- .filter(m => !m.deprecated)
954
- .map(m => ({
955
- id: m.id,
956
- name: m.name,
957
- provider: m.provider,
958
- description: m.description,
959
- contextWindow: m.limits.contextWindow,
960
- maxOutputTokens: m.limits.maxOutputTokens,
961
- supportsVision: m.features.vision,
962
- supportsFunctions: m.features.functionCalling,
963
- supportsStreaming: m.features.streaming,
964
- inputPrice: m.pricing?.inputPer1k,
965
- outputPrice: m.pricing?.outputPer1k,
966
- recommended: m.recommended || false,
967
- }));
968
- }
969
- export function registerCustomModel(model) {
970
- const existingIndex = MODEL_CATALOG.findIndex(m => m.id === model.id && m.provider === model.provider);
971
- if (existingIndex >= 0) {
972
- MODEL_CATALOG[existingIndex] = model;
973
- }
974
- else {
975
- MODEL_CATALOG.push(model);
976
- }
977
- }
978
- export async function fetchRemoteModels(_providerId, _apiKey, _baseUrl) {
979
- return [];
980
- }
981
- export function getFullModelRef(model) {
982
- return `${model.provider}/${model.id}`;
983
- }
984
- export function parseModelReference(ref) {
985
- if (ref.includes('/')) {
986
- const [provider, ...modelParts] = ref.split('/');
987
- return { provider, modelId: modelParts.join('/') };
988
- }
989
- return { modelId: ref };
990
- }
991
- export function findModelByRef(ref) {
992
- const { provider, modelId } = parseModelReference(ref);
993
- if (provider) {
994
- return findModelByProvider(provider, modelId);
995
- }
996
- return findModel(modelId);
997
- }
998
- //# sourceMappingURL=model-catalog.js.map