@lobehub/chat 1.29.2 → 1.29.4

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.4](https://github.com/lobehub/lobe-chat/compare/v1.29.3...v1.29.4)
6
+
7
+ <sup>Released on **2024-11-09**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Disregard remoteModelCards when showModelFetcher is disabled.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **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))
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.3](https://github.com/lobehub/lobe-chat/compare/v1.29.2...v1.29.3)
31
+
32
+ <sup>Released on **2024-11-09**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix the display model of history summary.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix the display model of history summary, closes [#4656](https://github.com/lobehub/lobe-chat/issues/4656) ([66cf2c1](https://github.com/lobehub/lobe-chat/commit/66cf2c1))
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.2](https://github.com/lobehub/lobe-chat/compare/v1.29.1...v1.29.2)
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.2",
3
+ "version": "1.29.4",
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",
@@ -8,8 +8,6 @@ import { useUserStore } from '@/store/user';
8
8
  import { systemAgentSelectors } from '@/store/user/selectors';
9
9
  import { ChatMessage } from '@/types/message';
10
10
 
11
- import { getAgentConfig } from './helpers';
12
-
13
11
  export interface ChatMemoryAction {
14
12
  internal_summaryHistory: (messages: ChatMessage[]) => Promise<void>;
15
13
  }
@@ -24,9 +22,7 @@ export const chatMemory: StateCreator<
24
22
  const topicId = get().activeTopicId;
25
23
  if (messages.length <= 1 || !topicId) return;
26
24
 
27
- const { model, provider } = getAgentConfig();
28
-
29
- const historyCompressConfig = systemAgentSelectors.historyCompress(useUserStore.getState());
25
+ const { model, provider } = systemAgentSelectors.historyCompress(useUserStore.getState());
30
26
 
31
27
  let historySummary = '';
32
28
  await chatService.fetchPresetTaskResult({
@@ -34,12 +30,7 @@ export const chatMemory: StateCreator<
34
30
  historySummary = text;
35
31
  },
36
32
 
37
- params: {
38
- ...chainSummaryHistory(messages),
39
- model: historyCompressConfig.model,
40
- provider: historyCompressConfig.provider,
41
- stream: false,
42
- },
33
+ params: { ...chainSummaryHistory(messages), model, provider, stream: false },
43
34
  });
44
35
 
45
36
  await topicService.updateTopic(topicId, {
@@ -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}`);