@lobehub/chat 0.110.7 → 0.110.9
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/.nvmrc +1 -0
- package/CHANGELOG.md +50 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/package.json +1 -1
- package/src/app/chat/(desktop)/features/ChatInput/index.tsx +11 -2
- package/src/chains/__tests__/summaryTitle.test.ts +2 -2
- package/src/chains/summaryTitle.ts +4 -3
- package/src/const/layoutTokens.ts +1 -0
- package/src/const/modelTokens.ts +1 -3
- package/src/store/global/selectors/__snapshots__/settings.test.ts.snap +0 -16
- package/src/types/llm.ts +0 -2
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
lts/hydrogen
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.110.9](https://github.com/lobehub/lobe-chat/compare/v0.110.8...v0.110.9)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-12-13**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: ChatInput should have maxHeight.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: ChatInput should have maxHeight, closes [#630](https://github.com/lobehub/lobe-chat/issues/630) ([8dfe1b8](https://github.com/lobehub/lobe-chat/commit/8dfe1b8))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.110.8](https://github.com/lobehub/lobe-chat/compare/v0.110.7...v0.110.8)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-12-12**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Clean up gpt-3.5 model.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Clean up gpt-3.5 model, closes [#554](https://github.com/lobehub/lobe-chat/issues/554) ([9616783](https://github.com/lobehub/lobe-chat/commit/9616783))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.110.7](https://github.com/lobehub/lobe-chat/compare/v0.110.6...v0.110.7)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2023-12-11**</sup>
|
package/README.md
CHANGED
|
@@ -204,14 +204,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
|
204
204
|
|
|
205
205
|
<!-- AGENT LIST -->
|
|
206
206
|
|
|
207
|
-
| Recent Submits
|
|
208
|
-
|
|
|
209
|
-
| [
|
|
210
|
-
| [
|
|
211
|
-
| [
|
|
212
|
-
| [
|
|
213
|
-
|
|
214
|
-
> 📊 Total agents: [<kbd>**
|
|
207
|
+
| Recent Submits | Description |
|
|
208
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
209
|
+
| [Python Coder Gradio](https://chat-preview.lobehub.com/market?agent=gradio-coding)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-12**</sup> | Python programmer experienced with Gradio for Hugging Face.<br/>`programming` `assistant` `python` |
|
|
210
|
+
| [GitHub Copilot](https://chat-preview.lobehub.com/market?agent=github-copilot)<br/><sup>By **[luciouskami](https://github.com/luciouskami)** on **2023-12-11**</sup> | GitHub Copilot<br/>`code` `it` |
|
|
211
|
+
| [Pollinate AI drawing](https://chat-preview.lobehub.com/market?agent=pollinations-drawing)<br/><sup>By **[mushan0x0](https://github.com/mushan0x0)** on **2023-12-11**</sup> | A drawing assistant that helps users enrich and optimize their descriptions and utilizes drawing abilities to display images in Markdown syntax<br/>`drawing` `enhancement` |
|
|
212
|
+
| [HTTP Request Master](https://chat-preview.lobehub.com/market?agent=http-request-master)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | I support extensive customization) To work, be sure to download and enable the "Website Crawler" plugin!<br/>`http-request` `http` `request` `web` |
|
|
213
|
+
|
|
214
|
+
> 📊 Total agents: [<kbd>**60**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
215
215
|
|
|
216
216
|
<!-- AGENT LIST -->
|
|
217
217
|
|
package/README.zh-CN.md
CHANGED
|
@@ -181,14 +181,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
|
181
181
|
|
|
182
182
|
<!-- AGENT LIST -->
|
|
183
183
|
|
|
184
|
-
| 最近新增
|
|
185
|
-
|
|
|
186
|
-
| [
|
|
187
|
-
| [
|
|
188
|
-
| [
|
|
189
|
-
| [
|
|
190
|
-
|
|
191
|
-
> 📊 Total agents: [<kbd>**
|
|
184
|
+
| 最近新增 | 助手说明 |
|
|
185
|
+
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
|
|
186
|
+
| [Python Gradio 代码师](https://chat-preview.lobehub.com/market?agent=gradio-coding)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-12**</sup> | 具有与 Hugging Face 合作的 Gradio 经验的 Python 程序员。<br/>`编程` `助手` `python` |
|
|
187
|
+
| [GitHub Copilot](https://chat-preview.lobehub.com/market?agent=github-copilot)<br/><sup>By **[luciouskami](https://github.com/luciouskami)** on **2023-12-11**</sup> | GitHub Copilot<br/>`code` `it` |
|
|
188
|
+
| [授粉 AI 画图](https://chat-preview.lobehub.com/market?agent=pollinations-drawing)<br/><sup>By **[mushan0x0](https://github.com/mushan0x0)** on **2023-12-11**</sup> | 一个绘画助手,通过用户的描述,帮其丰富润色优化,并且调用绘画能力,以 Markdown 语法展示图片<br/>`绘画` `润色` |
|
|
189
|
+
| [HTTP 请求大师](https://chat-preview.lobehub.com/market?agent=http-request-master)<br/><sup>By **[Igroshka](https://github.com/Igroshka)** on **2023-12-08**</sup> | 我支持广泛的定制。要使用,请确保下载并启用 “网站爬虫” 插件!<br/>`http-request` `http` `request` `web` |
|
|
190
|
+
|
|
191
|
+
> 📊 Total agents: [<kbd>**60**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
|
192
192
|
|
|
193
193
|
<!-- AGENT LIST -->
|
|
194
194
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.110.
|
|
3
|
+
"version": "0.110.9",
|
|
4
4
|
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
@@ -6,7 +6,11 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
import ActionBar from '@/app/chat/features/ChatInput/ActionBar';
|
|
7
7
|
import SaveTopic from '@/app/chat/features/ChatInput/Topic';
|
|
8
8
|
import { useChatInput } from '@/app/chat/features/ChatInput/useChatInput';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
CHAT_TEXTAREA_HEIGHT,
|
|
11
|
+
CHAT_TEXTAREA_MAX_HEIGHT,
|
|
12
|
+
HEADER_HEIGHT,
|
|
13
|
+
} from '@/const/layoutTokens';
|
|
10
14
|
|
|
11
15
|
import DragUpload from './DragUpload';
|
|
12
16
|
import { LocalFiles } from './LocalFiles';
|
|
@@ -77,7 +81,12 @@ const ChatInputDesktopLayout = memo(() => {
|
|
|
77
81
|
<ChatInputArea
|
|
78
82
|
bottomAddons={buttonAddons}
|
|
79
83
|
expand={expand}
|
|
80
|
-
heights={{
|
|
84
|
+
heights={{
|
|
85
|
+
headerHeight: HEADER_HEIGHT,
|
|
86
|
+
inputHeight,
|
|
87
|
+
maxHeight: CHAT_TEXTAREA_MAX_HEIGHT,
|
|
88
|
+
minHeight: CHAT_TEXTAREA_HEIGHT,
|
|
89
|
+
}}
|
|
81
90
|
loading={loading}
|
|
82
91
|
onInput={onInput}
|
|
83
92
|
onSend={onSend}
|
|
@@ -51,7 +51,7 @@ describe('chainSummaryTitle', () => {
|
|
|
51
51
|
role: 'user',
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
|
-
model: LanguageModel.
|
|
54
|
+
model: LanguageModel.GPT4_PREVIEW,
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
// Verify that getMessagesTokenCount was called with the correct messages
|
|
@@ -97,7 +97,7 @@ describe('chainSummaryTitle', () => {
|
|
|
97
97
|
role: 'user',
|
|
98
98
|
},
|
|
99
99
|
],
|
|
100
|
-
model
|
|
100
|
+
// No model specified since the token count is below the limit
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
// Verify that getMessagesTokenCount was called with the correct messages
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ModelTokens } from '@/const/modelTokens';
|
|
1
2
|
import { chatHelpers } from '@/store/chat/helpers';
|
|
2
3
|
import { globalHelpers } from '@/store/global/helpers';
|
|
3
4
|
import { LanguageModel } from '@/types/llm';
|
|
@@ -20,11 +21,11 @@ export const chainSummaryTitle = async (
|
|
|
20
21
|
role: 'user',
|
|
21
22
|
},
|
|
22
23
|
];
|
|
23
|
-
// 如果超过
|
|
24
|
+
// 如果超过 16k,则使用 GPT-4-turbo 模型
|
|
24
25
|
const tokens = await chatHelpers.getMessagesTokenCount(finalMessages);
|
|
25
26
|
let model: LanguageModel | undefined = undefined;
|
|
26
|
-
if (tokens >
|
|
27
|
-
model = LanguageModel.
|
|
27
|
+
if (tokens > ModelTokens[LanguageModel.GPT3_5]) {
|
|
28
|
+
model = LanguageModel.GPT4_PREVIEW;
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
return {
|
|
@@ -3,6 +3,7 @@ import type { FormProps } from '@lobehub/ui';
|
|
|
3
3
|
export const HEADER_HEIGHT = 64;
|
|
4
4
|
export const MOBILE_NABBAR_HEIGHT = 44;
|
|
5
5
|
export const MOBILE_TABBAR_HEIGHT = 48;
|
|
6
|
+
export const CHAT_TEXTAREA_MAX_HEIGHT = 800;
|
|
6
7
|
export const CHAT_TEXTAREA_HEIGHT = 230;
|
|
7
8
|
export const CHAT_TEXTAREA_HEIGHT_MOBILE = 108;
|
|
8
9
|
export const CHAT_SIDEBAR_WIDTH = 280;
|
package/src/const/modelTokens.ts
CHANGED
|
@@ -2,9 +2,7 @@ import { LanguageModel } from '@/types/llm';
|
|
|
2
2
|
|
|
3
3
|
// refs to: https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
|
|
4
4
|
export const ModelTokens: Record<LanguageModel, number> = {
|
|
5
|
-
[LanguageModel.GPT3_5]:
|
|
6
|
-
[LanguageModel.GPT3_5_1106]: 16_385,
|
|
7
|
-
[LanguageModel.GPT3_5_16K]: 16_385,
|
|
5
|
+
[LanguageModel.GPT3_5]: 16_385,
|
|
8
6
|
[LanguageModel.GPT4]: 8196,
|
|
9
7
|
[LanguageModel.GPT4_PREVIEW]: 128_000,
|
|
10
8
|
[LanguageModel.GPT4_VISION_PREVIEW]: 128_000,
|
|
@@ -23,14 +23,6 @@ exports[`settingsSelectors > CUSTOM_MODELS > duplicate naming model 1`] = `
|
|
|
23
23
|
"displayName": "gpt-3.5-turbo",
|
|
24
24
|
"name": "gpt-3.5-turbo",
|
|
25
25
|
},
|
|
26
|
-
{
|
|
27
|
-
"displayName": "gpt-3.5-turbo-1106",
|
|
28
|
-
"name": "gpt-3.5-turbo-1106",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"displayName": "gpt-3.5-turbo-16k",
|
|
32
|
-
"name": "gpt-3.5-turbo-16k",
|
|
33
|
-
},
|
|
34
26
|
{
|
|
35
27
|
"displayName": "gpt-4",
|
|
36
28
|
"name": "gpt-4",
|
|
@@ -56,14 +48,6 @@ exports[`settingsSelectors > CUSTOM_MODELS > only add the model 1`] = `
|
|
|
56
48
|
"displayName": "gpt-3.5-turbo",
|
|
57
49
|
"name": "gpt-3.5-turbo",
|
|
58
50
|
},
|
|
59
|
-
{
|
|
60
|
-
"displayName": "gpt-3.5-turbo-1106",
|
|
61
|
-
"name": "gpt-3.5-turbo-1106",
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"displayName": "gpt-3.5-turbo-16k",
|
|
65
|
-
"name": "gpt-3.5-turbo-16k",
|
|
66
|
-
},
|
|
67
51
|
{
|
|
68
52
|
"displayName": "gpt-4",
|
|
69
53
|
"name": "gpt-4",
|