@lobehub/chat 1.16.8 → 1.16.9

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.

Potentially problematic release.


This version of @lobehub/chat might be problematic. Click here for more details.

Files changed (37) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +1 -1
  3. package/src/config/modelProviders/ai360.ts +11 -0
  4. package/src/config/modelProviders/anthropic.ts +27 -18
  5. package/src/config/modelProviders/azure.ts +12 -3
  6. package/src/config/modelProviders/baichuan.ts +3 -1
  7. package/src/config/modelProviders/bedrock.ts +20 -18
  8. package/src/config/modelProviders/deepseek.ts +3 -1
  9. package/src/config/modelProviders/fireworksai.ts +33 -5
  10. package/src/config/modelProviders/google.ts +16 -13
  11. package/src/config/modelProviders/groq.ts +19 -8
  12. package/src/config/modelProviders/minimax.ts +8 -6
  13. package/src/config/modelProviders/mistral.ts +19 -3
  14. package/src/config/modelProviders/moonshot.ts +11 -1
  15. package/src/config/modelProviders/novita.ts +24 -0
  16. package/src/config/modelProviders/ollama.ts +58 -1
  17. package/src/config/modelProviders/openai.ts +52 -18
  18. package/src/config/modelProviders/openrouter.ts +21 -1
  19. package/src/config/modelProviders/perplexity.ts +19 -3
  20. package/src/config/modelProviders/qwen.ts +11 -8
  21. package/src/config/modelProviders/siliconcloud.ts +34 -1
  22. package/src/config/modelProviders/spark.ts +16 -7
  23. package/src/config/modelProviders/stepfun.ts +13 -1
  24. package/src/config/modelProviders/taichu.ts +7 -2
  25. package/src/config/modelProviders/togetherai.ts +38 -2
  26. package/src/config/modelProviders/upstage.ts +11 -4
  27. package/src/config/modelProviders/zeroone.ts +5 -1
  28. package/src/config/modelProviders/zhipu.ts +20 -18
  29. package/src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap +13 -6
  30. package/src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json +1 -0
  31. package/src/server/routers/edge/config/__snapshots__/index.test.ts.snap +24 -4
  32. package/src/server/routers/edge/config/index.test.ts +3 -11
  33. package/src/store/user/slices/modelList/__snapshots__/action.test.ts.snap +12 -0
  34. package/src/store/user/slices/modelList/action.test.ts +3 -7
  35. package/src/types/llm.ts +1 -0
  36. package/src/utils/__snapshots__/parseModels.test.ts.snap +32 -0
  37. package/src/utils/parseModels.test.ts +1 -28
@@ -154,13 +154,9 @@ describe('LLMSettingsSliceAction', () => {
154
154
 
155
155
  const ollamaList = result.current.modelProviderList.find((r) => r.id === 'ollama');
156
156
  // Assert that setModelProviderConfig was not called
157
- expect(ollamaList?.chatModels.find((c) => c.id === 'llava')).toEqual({
158
- displayName: 'LLaVA 7B',
159
- enabled: true,
160
- id: 'llava',
161
- tokens: 4096,
162
- vision: true,
163
- });
157
+ const model = ollamaList?.chatModels.find((c) => c.id === 'llava');
158
+
159
+ expect(model).toMatchSnapshot();
164
160
  });
165
161
 
166
162
  it('modelProviderListForModelSelect should return only enabled providers', () => {
package/src/types/llm.ts CHANGED
@@ -80,6 +80,7 @@ export interface ModelProviderCard {
80
80
  * @default false
81
81
  */
82
82
  defaultShowBrowserRequest?: boolean;
83
+ description?: string;
83
84
  /**
84
85
  * some provider server like stepfun and aliyun don't support browser request,
85
86
  * So we should disable it
@@ -61,3 +61,35 @@ exports[`parseModelString > only add the model 1`] = `
61
61
  "removed": [],
62
62
  }
63
63
  `;
64
+
65
+ exports[`transformToChatModelCards > should have file with builtin models like gpt-4-0125-preview 1`] = `
66
+ [
67
+ {
68
+ "description": "最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。",
69
+ "displayName": "ChatGPT-4",
70
+ "enabled": true,
71
+ "files": true,
72
+ "functionCall": true,
73
+ "id": "gpt-4-0125-preview",
74
+ "pricing": {
75
+ "input": 10,
76
+ "output": 30,
77
+ },
78
+ "tokens": 128000,
79
+ },
80
+ {
81
+ "description": "最新的 GPT-4 Turbo 模型具备视觉功能。现在,视觉请求可以使用 JSON 模式和函数调用。 GPT-4 Turbo 是一个增强版本,为多模态任务提供成本效益高的支持。它在准确性和效率之间找到平衡,适合需要进行实时交互的应用程序场景。",
82
+ "displayName": "ChatGPT-4 Vision",
83
+ "enabled": true,
84
+ "files": true,
85
+ "functionCall": true,
86
+ "id": "gpt-4-turbo-2024-04-09",
87
+ "pricing": {
88
+ "input": 10,
89
+ "output": 30,
90
+ },
91
+ "tokens": 128000,
92
+ "vision": true,
93
+ },
94
+ ]
95
+ `;
@@ -266,33 +266,6 @@ describe('transformToChatModelCards', () => {
266
266
  defaultChatModels: OpenAIProviderCard.chatModels,
267
267
  });
268
268
 
269
- expect(result).toEqual([
270
- {
271
- displayName: 'ChatGPT-4',
272
- files: true,
273
- functionCall: true,
274
- enabled: true,
275
- id: 'gpt-4-0125-preview',
276
- tokens: 128000,
277
- pricing: {
278
- input: 10,
279
- output: 30,
280
- },
281
- },
282
- {
283
- description: 'GPT-4 Turbo 视觉版 (240409)',
284
- displayName: 'ChatGPT-4 Vision',
285
- files: true,
286
- functionCall: true,
287
- enabled: true,
288
- id: 'gpt-4-turbo-2024-04-09',
289
- tokens: 128000,
290
- vision: true,
291
- pricing: {
292
- input: 10,
293
- output: 30,
294
- },
295
- },
296
- ]);
269
+ expect(result).toMatchSnapshot();
297
270
  });
298
271
  });