@lobehub/chat 1.29.3 → 1.29.5

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,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.29.5](https://github.com/lobehub/lobe-chat/compare/v1.29.4...v1.29.5)
6
+
7
+ <sup>Released on **2024-11-10**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix summary range.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix summary range, closes [#4664](https://github.com/lobehub/lobe-chat/issues/4664) ([140c301](https://github.com/lobehub/lobe-chat/commit/140c301))
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.29.4](https://github.com/lobehub/lobe-chat/compare/v1.29.3...v1.29.4)
31
+
32
+ <sup>Released on **2024-11-09**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Disregard remoteModelCards when showModelFetcher is disabled.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Disregard remoteModelCards when showModelFetcher is disabled, closes [#4644](https://github.com/lobehub/lobe-chat/issues/4644) ([a4431f2](https://github.com/lobehub/lobe-chat/commit/a4431f2))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.29.3](https://github.com/lobehub/lobe-chat/compare/v1.29.2...v1.29.3)
6
56
 
7
57
  <sup>Released on **2024-11-09**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.29.3",
3
+ "version": "1.29.5",
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",
@@ -102,7 +102,7 @@
102
102
  "dependencies": {
103
103
  "@ant-design/icons": "^5.5.1",
104
104
  "@ant-design/pro-components": "^2.7.18",
105
- "@anthropic-ai/sdk": "^0.31.0",
105
+ "@anthropic-ai/sdk": "^0.32.0",
106
106
  "@auth/core": "^0.37.0",
107
107
  "@aws-sdk/client-bedrock-runtime": "^3.675.0",
108
108
  "@aws-sdk/client-s3": "^3.675.0",
@@ -271,7 +271,7 @@
271
271
  "consola": "^3.2.3",
272
272
  "dotenv": "^16.4.5",
273
273
  "dpdm-fast": "^1.0.4",
274
- "drizzle-kit": "^0.27.0",
274
+ "drizzle-kit": "^0.28.0",
275
275
  "eslint": "^8.57.1",
276
276
  "eslint-plugin-mdx": "^2.3.4",
277
277
  "eslint-plugin-unused-imports": "4.0.1",
@@ -0,0 +1,15 @@
1
+ import Client from './Client';
2
+ import Redirect from './Redirect';
3
+
4
+ const ScreenLoading = () => {
5
+ return (
6
+ <>
7
+ <Client />
8
+ <Redirect />
9
+ </>
10
+ );
11
+ };
12
+
13
+ ScreenLoading.displayName = 'ScreenLoading';
14
+
15
+ export default ScreenLoading;
package/src/app/page.tsx CHANGED
@@ -2,22 +2,8 @@ import { Metadata } from 'next';
2
2
 
3
3
  import { getCanonicalUrl } from '@/server/utils/url';
4
4
 
5
- import Client from './(loading)/Client';
6
- import Redirect from './(loading)/Redirect';
7
-
8
5
  export const metadata: Metadata = {
9
6
  alternates: { canonical: getCanonicalUrl('/') },
10
7
  };
11
8
 
12
- const Page = () => {
13
- return (
14
- <>
15
- <Client />
16
- <Redirect />
17
- </>
18
- );
19
- };
20
-
21
- Page.displayName = 'Loading';
22
-
23
- export default Page;
9
+ export { default } from '@/app/loading';
@@ -332,7 +332,11 @@ export const generateAIChat: StateCreator<
332
332
  chatConfig.enableCompressHistory &&
333
333
  originalMessages.length > historyCount
334
334
  ) {
335
- const historyMessages = originalMessages.slice(0, -historyCount);
335
+ // after generation: [u1,a1,u2,a2,u3,a3]
336
+ // but the `originalMessages` is still: [u1,a1,u2,a2,u3]
337
+ // So if historyCount=2, we need to summary [u1,a1,u2,a2]
338
+ // because user find UI is [u1,a1,u2,a2 | u3,a3]
339
+ const historyMessages = originalMessages.slice(0, -historyCount + 1);
336
340
 
337
341
  await get().internal_summaryHistory(historyMessages);
338
342
  }
@@ -5,8 +5,8 @@ import type { StateCreator } from 'zustand/vanilla';
5
5
  import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
6
6
  import { ModelProvider } from '@/libs/agent-runtime';
7
7
  import { UserStore } from '@/store/user';
8
- import { ChatModelCard } from '@/types/llm';
9
- import {
8
+ import type { ChatModelCard, ModelProviderCard } from '@/types/llm';
9
+ import type {
10
10
  GlobalLLMProviderKey,
11
11
  UserKeyVaults,
12
12
  UserModelProviderConfig,
@@ -79,20 +79,21 @@ export const createModelListSlice: StateCreator<
79
79
  * 3 - default model cards
80
80
  */
81
81
 
82
- // eslint-disable-next-line unicorn/consistent-function-scoping
83
- const mergeModels = (provider: GlobalLLMProviderKey, defaultChatModels: ChatModelCard[]) => {
82
+ const mergeModels = (providerKey: GlobalLLMProviderKey, providerCard: ModelProviderCard) => {
84
83
  // if the chat model is config in the server side, use the server side model cards
85
- const serverChatModels = modelProviderSelectors.serverProviderModelCards(provider)(get());
86
- const remoteChatModels = modelProviderSelectors.remoteProviderModelCards(provider)(get());
84
+ const serverChatModels = modelProviderSelectors.serverProviderModelCards(providerKey)(get());
85
+ const remoteChatModels = providerCard.modelList?.showModelFetcher
86
+ ? modelProviderSelectors.remoteProviderModelCards(providerKey)(get())
87
+ : undefined;
87
88
 
88
- return serverChatModels ?? remoteChatModels ?? defaultChatModels;
89
+ return serverChatModels ?? remoteChatModels ?? providerCard.chatModels;
89
90
  };
90
91
 
91
92
  const defaultModelProviderList = produce(DEFAULT_MODEL_PROVIDER_LIST, (draft) => {
92
- Object.values(ModelProvider).forEach((id) =>{
93
- const provider = draft.find((d) => d.id === id);
94
- if (provider) provider.chatModels = mergeModels(id as any, provider.chatModels);
95
- })
93
+ Object.values(ModelProvider).forEach((id) => {
94
+ const provider = draft.find((d) => d.id === id);
95
+ if (provider) provider.chatModels = mergeModels(id as any, provider);
96
+ });
96
97
  });
97
98
 
98
99
  set({ defaultModelProviderList }, false, `refreshDefaultModelList - ${params?.trigger}`);
File without changes
File without changes