@lobehub/chat 1.88.17 → 1.88.18

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,32 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.88.18](https://github.com/lobehub/lobe-chat/compare/v1.88.17...v1.88.18)
6
+
7
+ <sup>Released on **2025-05-29**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Close historySummary correctly, Enable thinking output only for supported Gemini thinking models.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Close historySummary correctly, closes [#7010](https://github.com/lobehub/lobe-chat/issues/7010) ([90a6f68](https://github.com/lobehub/lobe-chat/commit/90a6f68))
21
+ - **misc**: Enable thinking output only for supported Gemini thinking models, closes [#7987](https://github.com/lobehub/lobe-chat/issues/7987) ([f503c53](https://github.com/lobehub/lobe-chat/commit/f503c53))
22
+
23
+ </details>
24
+
25
+ <div align="right">
26
+
27
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
28
+
29
+ </div>
30
+
5
31
  ### [Version 1.88.17](https://github.com/lobehub/lobe-chat/compare/v1.88.16...v1.88.17)
6
32
 
7
33
  <sup>Released on **2025-05-29**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "fixes": [
5
+ "Close historySummary correctly, Enable thinking output only for supported Gemini thinking models."
6
+ ]
7
+ },
8
+ "date": "2025-05-29",
9
+ "version": "1.88.18"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "improvements": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.88.17",
3
+ "version": "1.88.18",
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",
@@ -7,6 +7,8 @@ import { memo } from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
  import { Center, Flexbox } from 'react-layout-kit';
9
9
 
10
+ import { agentChatConfigSelectors } from '@/store/agent/selectors';
11
+ import { useAgentStore } from '@/store/agent/store';
10
12
  import { useChatStore } from '@/store/chat';
11
13
  import { topicSelectors } from '@/store/chat/selectors';
12
14
 
@@ -35,10 +37,14 @@ const History = memo(() => {
35
37
  return [history?.content, history?.model];
36
38
  });
37
39
 
40
+ const enableCompressHistory = useAgentStore(
41
+ (s) => agentChatConfigSelectors.currentChatConfig(s).enableCompressHistory,
42
+ );
43
+
38
44
  return (
39
45
  <Flexbox paddingInline={16} style={{ paddingBottom: 8 }}>
40
46
  <HistoryDivider enable />
41
- {!!content && (
47
+ {enableCompressHistory && !!content && (
42
48
  <Flexbox className={styles.container} gap={8}>
43
49
  <Flexbox align={'flex-start'} gap={8} horizontal>
44
50
  <Center height={20} width={20}>
@@ -117,8 +117,17 @@ export class LobeGoogleAI implements LobeRuntimeAI {
117
117
  const { model, thinking } = payload;
118
118
 
119
119
  const thinkingConfig: GoogleAIThinkingConfig = {
120
- includeThoughts: true,
121
- thinkingBudget: thinking?.type === 'enabled' ? Math.min(thinking.budget_tokens, 24_576) : 0,
120
+ includeThoughts:
121
+ (thinking?.type === 'enabled') ||
122
+ (!thinking && model && (model.includes('-2.5-') || model.includes('thinking')))
123
+ ? true
124
+ : undefined,
125
+ thinkingBudget:
126
+ thinking?.type === 'enabled'
127
+ ? Math.min(thinking.budget_tokens, 24_576)
128
+ : thinking?.type === 'disabled'
129
+ ? 0
130
+ : undefined,
122
131
  };
123
132
 
124
133
  const contents = await this.buildGoogleMessages(payload.messages);
@@ -132,8 +141,8 @@ export class LobeGoogleAI implements LobeRuntimeAI {
132
141
  // @ts-expect-error - Google SDK 0.24.0 doesn't have this property for now with
133
142
  response_modalities: modelsWithModalities.has(model) ? ['Text', 'Image'] : undefined,
134
143
  temperature: payload.temperature,
135
- thinkingConfig,
136
144
  topP: payload.top_p,
145
+ ...(modelsDisableInstuction.has(model) || model.toLowerCase().includes('learnlm') ? {} : { thinkingConfig }),
137
146
  },
138
147
  model,
139
148
  // avoid wide sensitive words
@@ -225,12 +225,20 @@ class ChatService {
225
225
  )(getAiInfraStoreState());
226
226
  // if model has extended params, then we need to check if the model can use reasoning
227
227
 
228
- if (modelExtendParams!.includes('enableReasoning') && chatConfig.enableReasoning) {
229
- extendParams.thinking = {
230
- budget_tokens: chatConfig.reasoningBudgetToken || 1024,
231
- type: 'enabled',
232
- };
228
+ if (modelExtendParams!.includes('enableReasoning')) {
229
+ if (chatConfig.enableReasoning) {
230
+ extendParams.thinking = {
231
+ budget_tokens: chatConfig.reasoningBudgetToken || 1024,
232
+ type: 'enabled',
233
+ };
234
+ } else {
235
+ extendParams.thinking = {
236
+ budget_tokens: 0,
237
+ type: 'disabled',
238
+ };
239
+ }
233
240
  }
241
+
234
242
  if (
235
243
  modelExtendParams!.includes('disableContextCaching') &&
236
244
  chatConfig.disableContextCaching
@@ -552,7 +552,9 @@ export const generateAIChat: StateCreator<
552
552
  // to upload image
553
553
  const uploadTasks: Map<string, Promise<{ id?: string; url?: string }>> = new Map();
554
554
 
555
- const historySummary = topicSelectors.currentActiveTopicSummary(get());
555
+ const historySummary = chatConfig.enableCompressHistory
556
+ ? topicSelectors.currentActiveTopicSummary(get())
557
+ : undefined;
556
558
  await chatService.createAssistantMessageStream({
557
559
  abortController,
558
560
  params: {