@lobehub/chat 1.46.4 โ†’ 1.46.6

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.46.6](https://github.com/lobehub/lobe-chat/compare/v1.46.5...v1.46.6)
6
+
7
+ <sup>Released on **2025-01-16**</sup>
8
+
9
+ #### ๐Ÿ› Bug Fixes
10
+
11
+ - **misc**: Gemini models HarmBlockThreshold.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Gemini models HarmBlockThreshold, closes [#5477](https://github.com/lobehub/lobe-chat/issues/5477) ([f98375c](https://github.com/lobehub/lobe-chat/commit/f98375c))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
30
+ ### [Version 1.46.5](https://github.com/lobehub/lobe-chat/compare/v1.46.4...v1.46.5)
31
+
32
+ <sup>Released on **2025-01-16**</sup>
33
+
34
+ <br/>
35
+
36
+ <details>
37
+ <summary><kbd>Improvements and Fixes</kbd></summary>
38
+
39
+ </details>
40
+
41
+ <div align="right">
42
+
43
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
44
+
45
+ </div>
46
+
5
47
  ### [Version 1.46.4](https://github.com/lobehub/lobe-chat/compare/v1.46.3...v1.46.4)
6
48
 
7
49
  <sup>Released on **2025-01-16**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,18 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Gemini models HarmBlockThreshold."
6
+ ]
7
+ },
8
+ "date": "2025-01-16",
9
+ "version": "1.46.6"
10
+ },
11
+ {
12
+ "children": {},
13
+ "date": "2025-01-16",
14
+ "version": "1.46.5"
15
+ },
2
16
  {
3
17
  "children": {
4
18
  "improvements": [
@@ -98,7 +98,7 @@ tags:
98
98
 
99
99
  ### ๆทปๅŠ  `APP_URL` ็Žฏๅขƒๅ˜้‡
100
100
 
101
- ่ฏฅ้ƒจๅˆ†ๆœ€ๅŽ้œ€่ฆๆทปๅŠ  `APP_UR`L ็Žฏๅขƒๅ˜้‡๏ผŒ็”จไบŽๆŒ‡ๅฎš LobeChat ๅบ”็”จ็š„ URL ๅœฐๅ€ใ€‚
101
+ ่ฏฅ้ƒจๅˆ†ๆœ€ๅŽ้œ€่ฆๆทปๅŠ  `APP_URL` ็Žฏๅขƒๅ˜้‡๏ผŒ็”จไบŽๆŒ‡ๅฎš LobeChat ๅบ”็”จ็š„ URL ๅœฐๅ€ใ€‚
102
102
  </Steps>
103
103
 
104
104
  ## ไบŒใ€ ้…็ฝฎ่บซไปฝ้ชŒ่ฏๆœๅŠก
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.46.4",
3
+ "version": "1.46.6",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -36,7 +36,14 @@ enum HarmCategory {
36
36
 
37
37
  enum HarmBlockThreshold {
38
38
  BLOCK_NONE = 'BLOCK_NONE',
39
- OFF = 'OFF', // https://discuss.ai.google.dev/t/59352
39
+ }
40
+
41
+ function getThreshold(model: string): HarmBlockThreshold {
42
+ const useOFF = ['gemini-2.0-flash-exp'];
43
+ if (useOFF.includes(model)) {
44
+ return 'OFF' as HarmBlockThreshold; // https://discuss.ai.google.dev/t/59352
45
+ }
46
+ return HarmBlockThreshold.BLOCK_NONE;
40
47
  }
41
48
 
42
49
  export class LobeGoogleAI implements LobeRuntimeAI {
@@ -71,19 +78,19 @@ export class LobeGoogleAI implements LobeRuntimeAI {
71
78
  safetySettings: [
72
79
  {
73
80
  category: HarmCategory.HARM_CATEGORY_HATE_SPEECH,
74
- threshold: model.includes('2.0') ? (HarmBlockThreshold.OFF as any) : HarmBlockThreshold.BLOCK_NONE,
81
+ threshold: getThreshold(model),
75
82
  },
76
83
  {
77
84
  category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
78
- threshold: model.includes('2.0') ? (HarmBlockThreshold.OFF as any) : HarmBlockThreshold.BLOCK_NONE,
85
+ threshold: getThreshold(model),
79
86
  },
80
87
  {
81
88
  category: HarmCategory.HARM_CATEGORY_HARASSMENT,
82
- threshold: model.includes('2.0') ? (HarmBlockThreshold.OFF as any) : HarmBlockThreshold.BLOCK_NONE,
89
+ threshold: getThreshold(model),
83
90
  },
84
91
  {
85
92
  category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
86
- threshold: model.includes('2.0') ? (HarmBlockThreshold.OFF as any) : HarmBlockThreshold.BLOCK_NONE,
93
+ threshold: getThreshold(model),
87
94
  },
88
95
  ],
89
96
  },
package/vercel.json CHANGED
@@ -1,3 +1,4 @@
1
1
  {
2
+ "buildCommand": "NODE_OPTIONS=--max-old-space-size=6144 next build",
2
3
  "installCommand": "bun install"
3
4
  }