@lobehub/chat 1.46.5 → 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 +25 -0
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/src/libs/agent-runtime/google/index.ts +12 -5
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
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
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.46.5](https://github.com/lobehub/lobe-chat/compare/v1.46.4...v1.46.5)
|
6
31
|
|
7
32
|
<sup>Released on **2025-01-16**</sup>
|
package/changelog/v1.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.46.
|
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
|
-
|
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
|
81
|
+
threshold: getThreshold(model),
|
75
82
|
},
|
76
83
|
{
|
77
84
|
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
|
78
|
-
threshold: model
|
85
|
+
threshold: getThreshold(model),
|
79
86
|
},
|
80
87
|
{
|
81
88
|
category: HarmCategory.HARM_CATEGORY_HARASSMENT,
|
82
|
-
threshold: model
|
89
|
+
threshold: getThreshold(model),
|
83
90
|
},
|
84
91
|
{
|
85
92
|
category: HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT,
|
86
|
-
threshold: model
|
93
|
+
threshold: getThreshold(model),
|
87
94
|
},
|
88
95
|
],
|
89
96
|
},
|