@lobehub/chat 0.115.6 → 0.115.8

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 0.115.8](https://github.com/lobehub/lobe-chat/compare/v0.115.7...v0.115.8)
6
+
7
+ <sup>Released on **2023-12-24**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix CUSTOM_MODEL `-` operator not working.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix CUSTOM_MODEL `-` operator not working, closes [#791](https://github.com/lobehub/lobe-chat/issues/791) ([26b968f](https://github.com/lobehub/lobe-chat/commit/26b968f))
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 0.115.7](https://github.com/lobehub/lobe-chat/compare/v0.115.6...v0.115.7)
31
+
32
+ <sup>Released on **2023-12-23**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Fix auto scrolling when generating message.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Fix auto scrolling when generating message, closes [#785](https://github.com/lobehub/lobe-chat/issues/785) ([1a236e6](https://github.com/lobehub/lobe-chat/commit/1a236e6))
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 0.115.6](https://github.com/lobehub/lobe-chat/compare/v0.115.5...v0.115.6)
6
56
 
7
57
  <sup>Released on **2023-12-23**</sup>
package/README.md CHANGED
@@ -206,14 +206,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
206
206
 
207
207
  <!-- AGENT LIST -->
208
208
 
209
- | Recent Submits | Description |
210
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------- |
211
- | [Facebook Ads Expert](https://chat-preview.lobehub.com/market?agent=facebook-ads-expert)<br/><sup>By **[alissonryan](https://github.com/alissonryan)** on **2023-12-20**</sup> | Create a Facebook Ads with a expert<br/>`copywriting` `facebook-ads` `lead-generation` |
212
- | [Dream Painter](https://chat-preview.lobehub.com/market?agent=dream-painter)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | A dream artist who can bring your dreams into reality.<br/>`txt-2-img` `painter` |
213
- | [NewsHub](https://chat-preview.lobehub.com/market?agent=news-hub)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | A news search assistant proficient at finding and presenting relevant news<br/>`news` `search` `helper` |
214
- | [NewsNest](https://chat-preview.lobehub.com/market?agent=news-nest)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | A news search assistant, can help you find and display relevant news based on your needs.<br/>`news` `search` |
215
-
216
- > 📊 Total agents: [<kbd>**79**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
209
+ | Recent Submits | Description |
210
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
211
+ | [Facebook Ads Expert](https://chat-preview.lobehub.com/market?agent=facebook-ads-expert)<br/><sup>By **[alissonryan](https://github.com/alissonryan)** on **2023-12-20**</sup> | Create a Facebook Ads with a expert<br/>`copywriting` `facebook-ads` `lead-generation` |
212
+ | [Dream Painter](https://chat-preview.lobehub.com/market?agent=dream-painter)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | A dream artist who can bring your dreams into reality.<br/>`txt-2-img` `painter` |
213
+ | [News Hub](https://chat-preview.lobehub.com/market?agent=news-hub)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | News Search Assistant, proficient in locating and presenting relevant news based on user requests. Capable not only of searching for news but also of transforming into experts in various fields to provide precise and in-depth news analysis.<br/>`news` `search` `helper` |
214
+ | [Research Assistant](https://chat-preview.lobehub.com/market?agent=research-assistant)<br/><sup>By **[ccsen](https://github.com/ccsen)** on **2023-12-19**</sup> | Capable of answering questions, conducting research, drafting content, and more, utilizing scientific research papers.<br/>`research-assistant` `literature-retrieval` `writing` `scientific-research` `citation` |
215
+
216
+ > 📊 Total agents: [<kbd>**77**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
217
217
 
218
218
  <!-- AGENT LIST -->
219
219
 
package/README.zh-CN.md CHANGED
@@ -183,14 +183,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
183
183
 
184
184
  <!-- AGENT LIST -->
185
185
 
186
- | 最近新增 | 助手说明 |
187
- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
188
- | [Facebook 广告专家](https://chat-preview.lobehub.com/market?agent=facebook-ads-expert)<br/><sup>By **[alissonryan](https://github.com/alissonryan)** on **2023-12-20**</sup> | 与专家一起创建 Facebook 广告<br/>`文案撰写` `facebook广告` `潜在客户生成` |
189
- | [梦境画家](https://chat-preview.lobehub.com/market?agent=dream-painter)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | 一位能将你的梦想变成现实的梦境艺术家。<br/>`txt-2-img` `painter` |
190
- | [NewsHub](https://chat-preview.lobehub.com/market?agent=news-hub)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | 一个新闻搜索助手,擅长查找和呈现相关新闻<br/>`新闻` `搜索` `助手` |
191
- | [NewsNest](https://chat-preview.lobehub.com/market?agent=news-nest)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | 一个新闻搜索助手,可以根据您的需求帮助您查找和显示相关新闻。<br/>`新闻` `搜索` |
192
-
193
- > 📊 Total agents: [<kbd>**79**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
186
+ | 最近新增 | 助手说明 |
187
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
188
+ | [Facebook 广告专家](https://chat-preview.lobehub.com/market?agent=facebook-ads-expert)<br/><sup>By **[alissonryan](https://github.com/alissonryan)** on **2023-12-20**</sup> | 与专家一起创建 Facebook 广告<br/>`文案撰写` `facebook广告` `潜在客户生成` |
189
+ | [梦境画家](https://chat-preview.lobehub.com/market?agent=dream-painter)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | 一位能将你的梦想变成现实的梦境艺术家。<br/>`txt-2-img` `painter` |
190
+ | [新闻搜索助手](https://chat-preview.lobehub.com/market?agent=news-hub)<br/><sup>By **[ccdanpian](https://github.com/ccdanpian)** on **2023-12-19**</sup> | 新闻搜索助手,精通根据用户需求查找和呈现相关新闻。不仅能够搜索新闻,还可以根据用户的要求转变为不同领域的专家,提供精确深入的新闻解读<br/>`新闻` `搜索` `助手` |
191
+ | [研究助理](https://chat-preview.lobehub.com/market?agent=research-assistant)<br/><sup>By **[ccsen](https://github.com/ccsen)** on **2023-12-19**</sup> | 能够回答问题,进行研究,起草内容等,利用科学研究论文。<br/>`research-assistant` `literature-retrieval` `writing` `scientific-research` `citation` |
192
+
193
+ > 📊 Total agents: [<kbd>**77**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
194
194
 
195
195
  <!-- AGENT LIST -->
196
196
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.115.6",
3
+ "version": "0.115.8",
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",
@@ -76,7 +76,7 @@
76
76
  "@lobehub/chat-plugin-sdk": "latest",
77
77
  "@lobehub/chat-plugins-gateway": "latest",
78
78
  "@lobehub/tts": "latest",
79
- "@lobehub/ui": "~1.121.0",
79
+ "@lobehub/ui": "latest",
80
80
  "@vercel/analytics": "^1",
81
81
  "ahooks": "^3",
82
82
  "ai": "^2.2.22",
@@ -2,11 +2,13 @@ import { memo, useEffect } from 'react';
2
2
  import { useInView } from 'react-intersection-observer';
3
3
 
4
4
  import { useChatStore } from '@/store/chat';
5
+ import { chatSelectors } from '@/store/chat/selectors';
5
6
 
6
7
  import { useAtBottom } from './useAtBottom';
7
8
 
8
9
  const ChatScrollAnchor = memo(() => {
9
10
  const trackVisibility = useChatStore((s) => !!s.chatLoadingId);
11
+ const str = useChatStore(chatSelectors.chatsMessageString);
10
12
 
11
13
  const isAtBottom = useAtBottom();
12
14
  const { ref, entry, inView } = useInView({
@@ -17,11 +19,9 @@ const ChatScrollAnchor = memo(() => {
17
19
 
18
20
  useEffect(() => {
19
21
  if (isAtBottom && trackVisibility && !inView) {
20
- entry?.target.scrollIntoView({
21
- block: 'start',
22
- });
22
+ entry?.target.scrollIntoView({ block: 'start' });
23
23
  }
24
- }, [inView, entry, isAtBottom, trackVisibility]);
24
+ }, [inView, entry, isAtBottom, trackVisibility, str]);
25
25
 
26
26
  return <div ref={ref} style={{ height: 1, width: '100%' }} />;
27
27
  });
@@ -94,6 +94,48 @@ describe('settingsSelectors', () => {
94
94
  expect(result).toMatchSnapshot();
95
95
  });
96
96
 
97
+ it('should delete model', () => {
98
+ const s = {
99
+ serverConfig: {
100
+ customModelName: '-gpt-4',
101
+ },
102
+ settings: {
103
+ languageModel: {
104
+ openAI: {},
105
+ },
106
+ },
107
+ } as unknown as GlobalStore;
108
+
109
+ const result = settingsSelectors.modelList(s);
110
+
111
+ expect(result).toEqual([
112
+ {
113
+ displayName: 'gpt-3.5-turbo',
114
+ name: 'gpt-3.5-turbo',
115
+ },
116
+ {
117
+ displayName: 'gpt-3.5-turbo-1106',
118
+ name: 'gpt-3.5-turbo-1106',
119
+ },
120
+ {
121
+ displayName: 'gpt-3.5-turbo-16k',
122
+ name: 'gpt-3.5-turbo-16k',
123
+ },
124
+ {
125
+ displayName: 'gpt-4-32k',
126
+ name: 'gpt-4-32k',
127
+ },
128
+ {
129
+ displayName: 'gpt-4-1106-preview',
130
+ name: 'gpt-4-1106-preview',
131
+ },
132
+ {
133
+ displayName: 'gpt-4-vision-preview',
134
+ name: 'gpt-4-vision-preview',
135
+ },
136
+ ]);
137
+ });
138
+
97
139
  it('only add the model', () => {
98
140
  const s = {
99
141
  serverConfig: {},
@@ -31,6 +31,7 @@ const openAIProxyUrlSelectors = (s: GlobalStore) => s.settings.languageModel.ope
31
31
  const modelListSelectors = (s: GlobalStore) => {
32
32
  let models: CustomModels = [];
33
33
 
34
+ const removedModels: string[] = [];
34
35
  const modelNames = [
35
36
  ...DEFAULT_OPENAI_MODEL_LIST,
36
37
  ...(s.serverConfig.customModelName || '').split(/[,,]/).filter(Boolean),
@@ -47,6 +48,7 @@ const modelListSelectors = (s: GlobalStore) => {
47
48
  if (name === 'all') {
48
49
  models = [];
49
50
  }
51
+ removedModels.push(name);
50
52
  continue;
51
53
  }
52
54
 
@@ -62,7 +64,7 @@ const modelListSelectors = (s: GlobalStore) => {
62
64
  });
63
65
  }
64
66
 
65
- return models;
67
+ return models.filter((m) => !removedModels.includes(m.name));
66
68
  };
67
69
 
68
70
  export const exportSettings = (s: GlobalStore) => {