@lobehub/chat 1.51.7 → 1.51.8

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 (43) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.ja-JP.md +8 -8
  3. package/README.md +8 -8
  4. package/README.zh-CN.md +8 -8
  5. package/changelog/v1.json +9 -0
  6. package/package.json +1 -1
  7. package/src/app/(backend)/webapi/chat/models/[provider]/route.ts +1 -1
  8. package/src/libs/agent-runtime/ai360/index.ts +8 -1
  9. package/src/libs/agent-runtime/anthropic/index.ts +2 -1
  10. package/src/libs/agent-runtime/baichuan/index.ts +1 -1
  11. package/src/libs/agent-runtime/cloudflare/index.test.ts +0 -117
  12. package/src/libs/agent-runtime/cloudflare/index.ts +32 -11
  13. package/src/libs/agent-runtime/deepseek/index.ts +4 -1
  14. package/src/libs/agent-runtime/fireworksai/index.ts +8 -1
  15. package/src/libs/agent-runtime/giteeai/index.ts +9 -1
  16. package/src/libs/agent-runtime/github/index.test.ts +5 -16
  17. package/src/libs/agent-runtime/github/index.ts +31 -33
  18. package/src/libs/agent-runtime/google/index.ts +2 -1
  19. package/src/libs/agent-runtime/groq/index.ts +7 -1
  20. package/src/libs/agent-runtime/higress/index.ts +2 -1
  21. package/src/libs/agent-runtime/huggingface/index.ts +10 -1
  22. package/src/libs/agent-runtime/hunyuan/index.ts +3 -1
  23. package/src/libs/agent-runtime/internlm/index.ts +3 -1
  24. package/src/libs/agent-runtime/mistral/index.ts +2 -1
  25. package/src/libs/agent-runtime/moonshot/index.ts +3 -1
  26. package/src/libs/agent-runtime/novita/__snapshots__/index.test.ts.snap +48 -12
  27. package/src/libs/agent-runtime/novita/index.ts +9 -1
  28. package/src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap +70 -66
  29. package/src/libs/agent-runtime/openai/index.ts +37 -0
  30. package/src/libs/agent-runtime/openrouter/__snapshots__/index.test.ts.snap +172 -4
  31. package/src/libs/agent-runtime/openrouter/index.ts +17 -2
  32. package/src/libs/agent-runtime/qwen/index.ts +10 -1
  33. package/src/libs/agent-runtime/sensenova/index.ts +3 -1
  34. package/src/libs/agent-runtime/siliconcloud/index.ts +10 -1
  35. package/src/libs/agent-runtime/stepfun/index.ts +3 -1
  36. package/src/libs/agent-runtime/togetherai/__snapshots__/index.test.ts.snap +1309 -5
  37. package/src/libs/agent-runtime/togetherai/index.test.ts +0 -13
  38. package/src/libs/agent-runtime/togetherai/index.ts +25 -20
  39. package/src/libs/agent-runtime/utils/cloudflareHelpers.test.ts +0 -99
  40. package/src/libs/agent-runtime/utils/cloudflareHelpers.ts +0 -70
  41. package/src/libs/agent-runtime/xai/index.ts +3 -1
  42. package/src/libs/agent-runtime/zeroone/index.ts +3 -1
  43. package/src/libs/agent-runtime/zhipu/index.ts +3 -1
@@ -17,13 +17,27 @@ export const LobeOpenRouterAI = LobeOpenAICompatibleFactory({
17
17
  },
18
18
  models: {
19
19
  transformModel: (m) => {
20
+ const visionKeywords = [
21
+ 'qwen/qvq',
22
+ 'vision',
23
+ ];
24
+
25
+ const reasoningKeywords = [
26
+ 'deepseek/deepseek-r1',
27
+ 'openai/o1',
28
+ 'openai/o3',
29
+ 'qwen/qvq',
30
+ 'qwen/qwq',
31
+ 'thinking'
32
+ ];
33
+
20
34
  const model = m as unknown as OpenRouterModelCard;
21
35
 
22
36
  return {
23
37
  contextWindowTokens: model.context_length,
24
38
  description: model.description,
25
39
  displayName: model.name,
26
- enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
40
+ enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.enabled || false,
27
41
  functionCall:
28
42
  model.description.includes('function calling') || model.description.includes('tools'),
29
43
  id: model.id,
@@ -31,10 +45,11 @@ export const LobeOpenRouterAI = LobeOpenAICompatibleFactory({
31
45
  typeof model.top_provider.max_completion_tokens === 'number'
32
46
  ? model.top_provider.max_completion_tokens
33
47
  : undefined,
48
+ reasoning: reasoningKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
34
49
  vision:
35
50
  model.description.includes('vision') ||
36
51
  model.description.includes('multimodal') ||
37
- model.id.includes('vision'),
52
+ visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
38
53
  };
39
54
  },
40
55
  },
@@ -84,12 +84,21 @@ export const LobeQwenAI = LobeOpenAICompatibleFactory({
84
84
  'vl',
85
85
  ];
86
86
 
87
+ const reasoningKeywords = [
88
+ 'qvq',
89
+ 'qwq',
90
+ 'deepseek-r1'
91
+ ];
92
+
87
93
  const model = m as unknown as QwenModelCard;
88
94
 
89
95
  return {
90
- enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
96
+ contextWindowTokens: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.contextWindowTokens ?? undefined,
97
+ displayName: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.displayName ?? undefined,
98
+ enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.enabled || false,
91
99
  functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
92
100
  id: model.id,
101
+ reasoning: reasoningKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
93
102
  vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
94
103
  };
95
104
  },
@@ -45,7 +45,9 @@ export const LobeSenseNovaAI = LobeOpenAICompatibleFactory({
45
45
  return modelList
46
46
  .map((model) => {
47
47
  return {
48
- enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
48
+ contextWindowTokens: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.contextWindowTokens ?? undefined,
49
+ displayName: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.displayName ?? undefined,
50
+ enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.enabled || false,
49
51
  functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
50
52
  id: model.id,
51
53
  vision: model.id.toLowerCase().includes('vision'),
@@ -71,12 +71,21 @@ export const LobeSiliconCloudAI = LobeOpenAICompatibleFactory({
71
71
  'deepseek-ai/deepseek-vl',
72
72
  ];
73
73
 
74
+ const reasoningKeywords = [
75
+ 'deepseek-ai/deepseek-r1',
76
+ 'qwen/qvq',
77
+ 'qwen/qwq',
78
+ ];
79
+
74
80
  const model = m as unknown as SiliconCloudModelCard;
75
81
 
76
82
  return {
77
- enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
83
+ contextWindowTokens: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.contextWindowTokens ?? undefined,
84
+ displayName: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.displayName ?? undefined,
85
+ enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.enabled || false,
78
86
  functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)) && !model.id.toLowerCase().includes('deepseek-r1'),
79
87
  id: model.id,
88
+ reasoning: reasoningKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
80
89
  vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
81
90
  };
82
91
  },
@@ -38,7 +38,9 @@ export const LobeStepfunAI = LobeOpenAICompatibleFactory({
38
38
  const model = m as unknown as StepfunModelCard;
39
39
 
40
40
  return {
41
- enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id.endsWith(m.id))?.enabled || false,
41
+ contextWindowTokens: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.contextWindowTokens ?? undefined,
42
+ displayName: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.displayName ?? undefined,
43
+ enabled: LOBE_DEFAULT_MODEL_LIST.find((m) => model.id === m.id)?.enabled || false,
42
44
  functionCall: functionCallKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),
43
45
  id: model.id,
44
46
  vision: visionKeywords.some(keyword => model.id.toLowerCase().includes(keyword)),