@lobehub/chat 1.88.11 → 1.88.13
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 +42 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/changelog/v1.json +14 -0
- package/package.json +2 -1
- package/src/config/aiModels/google.ts +2 -0
- package/src/libs/model-runtime/google/index.ts +3 -1
- package/src/libs/model-runtime/types/chat.ts +1 -1
- package/src/utils/tokenizer/estimated.ts +4 -0
- package/src/utils/tokenizer/index.ts +5 -5
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,48 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.88.13](https://github.com/lobehub/lobe-chat/compare/v1.88.12...v1.88.13)
|
6
|
+
|
7
|
+
<sup>Released on **2025-05-27**</sup>
|
8
|
+
|
9
|
+
<br/>
|
10
|
+
|
11
|
+
<details>
|
12
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
13
|
+
|
14
|
+
</details>
|
15
|
+
|
16
|
+
<div align="right">
|
17
|
+
|
18
|
+
[](#readme-top)
|
19
|
+
|
20
|
+
</div>
|
21
|
+
|
22
|
+
### [Version 1.88.12](https://github.com/lobehub/lobe-chat/compare/v1.88.11...v1.88.12)
|
23
|
+
|
24
|
+
<sup>Released on **2025-05-27**</sup>
|
25
|
+
|
26
|
+
#### 💄 Styles
|
27
|
+
|
28
|
+
- **misc**: Support adjust thinkingBudget in gemini 2.5 flash.
|
29
|
+
|
30
|
+
<br/>
|
31
|
+
|
32
|
+
<details>
|
33
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
34
|
+
|
35
|
+
#### Styles
|
36
|
+
|
37
|
+
- **misc**: Support adjust thinkingBudget in gemini 2.5 flash, closes [#7947](https://github.com/lobehub/lobe-chat/issues/7947) ([a9db548](https://github.com/lobehub/lobe-chat/commit/a9db548))
|
38
|
+
|
39
|
+
</details>
|
40
|
+
|
41
|
+
<div align="right">
|
42
|
+
|
43
|
+
[](#readme-top)
|
44
|
+
|
45
|
+
</div>
|
46
|
+
|
5
47
|
### [Version 1.88.11](https://github.com/lobehub/lobe-chat/compare/v1.88.10...v1.88.11)
|
6
48
|
|
7
49
|
<sup>Released on **2025-05-26**</sup>
|
package/README.md
CHANGED
@@ -327,14 +327,14 @@ In addition, these plugins are not limited to news aggregation, but can also ext
|
|
327
327
|
|
328
328
|
<!-- PLUGIN LIST -->
|
329
329
|
|
330
|
-
| Recent Submits
|
331
|
-
|
|
332
|
-
| [
|
333
|
-
| [
|
334
|
-
| [
|
335
|
-
| [
|
336
|
-
|
337
|
-
> 📊 Total plugins: [<kbd>**
|
330
|
+
| Recent Submits | Description |
|
331
|
+
| ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
332
|
+
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2025-05-27**</sup> | Analyze stocks and get comprehensive real-time investment data and analytics.<br/>`stock` |
|
333
|
+
| [Web](https://lobechat.com/discover/plugin/web)<br/><sup>By **Proghit** on **2025-01-24**</sup> | Smart web search that reads and analyzes pages to deliver comprehensive answers from Google results.<br/>`web` `search` |
|
334
|
+
| [Bing_websearch](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | Search for information from the internet base BingApi<br/>`bingsearch` |
|
335
|
+
| [Google CSE](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | Searches Google through their official CSE API.<br/>`web` `search` |
|
336
|
+
|
337
|
+
> 📊 Total plugins: [<kbd>**43**</kbd>](https://lobechat.com/discover/plugins)
|
338
338
|
|
339
339
|
<!-- PLUGIN LIST -->
|
340
340
|
|
package/README.zh-CN.md
CHANGED
@@ -320,14 +320,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
320
320
|
|
321
321
|
<!-- PLUGIN LIST -->
|
322
322
|
|
323
|
-
| 最近新增
|
324
|
-
|
|
325
|
-
| [
|
326
|
-
| [
|
327
|
-
| [
|
328
|
-
| [
|
329
|
-
|
330
|
-
> 📊 Total plugins: [<kbd>**
|
323
|
+
| 最近新增 | 描述 |
|
324
|
+
| -------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
|
325
|
+
| [PortfolioMeta](https://lobechat.com/discover/plugin/StockData)<br/><sup>By **portfoliometa** on **2025-05-27**</sup> | 分析股票并获取全面的实时投资数据和分析。<br/>`股票` |
|
326
|
+
| [网页](https://lobechat.com/discover/plugin/web)<br/><sup>By **Proghit** on **2025-01-24**</sup> | 智能网页搜索,读取和分析页面,以提供来自 Google 结果的全面答案。<br/>`网页` `搜索` |
|
327
|
+
| [必应网页搜索](https://lobechat.com/discover/plugin/Bingsearch-identifier)<br/><sup>By **FineHow** on **2024-12-22**</sup> | 通过 BingApi 搜索互联网上的信息<br/>`bingsearch` |
|
328
|
+
| [谷歌自定义搜索引擎](https://lobechat.com/discover/plugin/google-cse)<br/><sup>By **vsnthdev** on **2024-12-02**</sup> | 通过他们的官方自定义搜索引擎 API 搜索谷歌。<br/>`网络` `搜索` |
|
329
|
+
|
330
|
+
> 📊 Total plugins: [<kbd>**43**</kbd>](https://lobechat.com/discover/plugins)
|
331
331
|
|
332
332
|
<!-- PLUGIN LIST -->
|
333
333
|
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,18 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {},
|
4
|
+
"date": "2025-05-27",
|
5
|
+
"version": "1.88.13"
|
6
|
+
},
|
7
|
+
{
|
8
|
+
"children": {
|
9
|
+
"improvements": [
|
10
|
+
"Support adjust thinkingBudget in gemini 2.5 flash."
|
11
|
+
]
|
12
|
+
},
|
13
|
+
"date": "2025-05-27",
|
14
|
+
"version": "1.88.12"
|
15
|
+
},
|
2
16
|
{
|
3
17
|
"children": {
|
4
18
|
"improvements": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.88.
|
3
|
+
"version": "1.88.13",
|
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",
|
@@ -255,6 +255,7 @@
|
|
255
255
|
"svix": "^1.65.0",
|
256
256
|
"swr": "^2.3.3",
|
257
257
|
"systemjs": "^6.15.1",
|
258
|
+
"tokenx": "^0.4.1",
|
258
259
|
"ts-md5": "^1.3.1",
|
259
260
|
"ua-parser-js": "^1.0.40",
|
260
261
|
"unstructured-client": "^0.19.0",
|
@@ -68,6 +68,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
68
68
|
},
|
69
69
|
releasedAt: '2025-05-20',
|
70
70
|
settings: {
|
71
|
+
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
71
72
|
searchImpl: 'params',
|
72
73
|
searchProvider: 'google',
|
73
74
|
},
|
@@ -91,6 +92,7 @@ const googleChatModels: AIChatModelCard[] = [
|
|
91
92
|
},
|
92
93
|
releasedAt: '2025-04-17',
|
93
94
|
settings: {
|
95
|
+
extendParams: ['enableReasoning', 'reasoningBudgetToken'],
|
94
96
|
searchImpl: 'params',
|
95
97
|
searchProvider: 'google',
|
96
98
|
},
|
@@ -89,6 +89,7 @@ interface LobeGoogleAIParams {
|
|
89
89
|
|
90
90
|
interface GoogleAIThinkingConfig {
|
91
91
|
includeThoughts?: boolean;
|
92
|
+
thinkingBudget?: number;
|
92
93
|
}
|
93
94
|
|
94
95
|
export class LobeGoogleAI implements LobeRuntimeAI {
|
@@ -113,10 +114,11 @@ export class LobeGoogleAI implements LobeRuntimeAI {
|
|
113
114
|
async chat(rawPayload: ChatStreamPayload, options?: ChatCompetitionOptions) {
|
114
115
|
try {
|
115
116
|
const payload = this.buildPayload(rawPayload);
|
116
|
-
const model = payload
|
117
|
+
const { model, thinking } = payload;
|
117
118
|
|
118
119
|
const thinkingConfig: GoogleAIThinkingConfig = {
|
119
120
|
includeThoughts: true,
|
121
|
+
thinkingBudget: thinking?.type === 'enabled' ? Math.min(thinking.budget_tokens, 24_576) : 0,
|
120
122
|
};
|
121
123
|
|
122
124
|
const contents = await this.buildGoogleMessages(payload.messages);
|
@@ -1,15 +1,15 @@
|
|
1
1
|
export const encodeAsync = async (str: string): Promise<number> => {
|
2
2
|
if (str.length === 0) return 0;
|
3
3
|
|
4
|
-
//
|
5
|
-
//
|
6
|
-
if (str.length <=
|
4
|
+
// use gpt-tokenizer under 10000 str
|
5
|
+
// use approximation way if large then 10000
|
6
|
+
if (str.length <= 10_000) {
|
7
7
|
const { clientEncodeAsync } = await import('./client');
|
8
8
|
|
9
9
|
return await clientEncodeAsync(str);
|
10
10
|
} else {
|
11
|
-
const {
|
11
|
+
const { estimatedEncodeAsync } = await import('./estimated');
|
12
12
|
|
13
|
-
return await
|
13
|
+
return await estimatedEncodeAsync(str);
|
14
14
|
}
|
15
15
|
};
|