@lobehub/chat 0.111.2 → 0.111.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 +50 -0
- package/docs/Development-Guide/index.zh-CN.md +1 -1
- package/docs/Plugin-Development.md +1 -1
- package/docs/Plugin-Development.zh-CN.md +1 -1
- package/locales/zh_CN/chat.json +1 -1
- package/locales/zh_CN/setting.json +2 -2
- package/package.json +1 -1
- package/src/chains/__tests__/summaryTitle.test.ts +2 -2
- package/src/chains/summaryTitle.ts +3 -4
- package/src/const/modelTokens.ts +3 -1
- package/src/features/AgentSetting/AgentConfig/index.tsx +1 -1
- package/src/locales/default/chat.ts +1 -1
- package/src/locales/default/setting.ts +2 -2
- package/src/store/global/selectors/__snapshots__/settings.test.ts.snap +16 -0
- package/src/types/llm.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.111.4](https://github.com/lobehub/lobe-chat/compare/v0.111.3...v0.111.4)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-12-14**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Revert "🐛 fix: clean up gpt-3.5 model".
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Revert "🐛 fix: clean up gpt-3.5 model", closes [#653](https://github.com/lobehub/lobe-chat/issues/653) ([b8b14fc](https://github.com/lobehub/lobe-chat/commit/b8b14fc))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
### [Version 0.111.3](https://github.com/lobehub/lobe-chat/compare/v0.111.2...v0.111.3)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2023-12-14**</sup>
|
|
33
|
+
|
|
34
|
+
#### 🐛 Bug Fixes
|
|
35
|
+
|
|
36
|
+
- **misc**: Fix the history-count text.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's fixed
|
|
44
|
+
|
|
45
|
+
- **misc**: Fix the history-count text, closes [#615](https://github.com/lobehub/lobe-chat/issues/615) ([4db1cef](https://github.com/lobehub/lobe-chat/commit/4db1cef))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 0.111.2](https://github.com/lobehub/lobe-chat/compare/v0.111.1...v0.111.2)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2023-12-13**</sup>
|
|
@@ -13,7 +13,7 @@ LobeChat 的核心技术栈如下:
|
|
|
13
13
|
- **路由**:路由管理我们直接使用 [Next.js](https://nextjs.org/) 自身提供的解决方案。
|
|
14
14
|
- **国际化**:我们使用 [i18next](https://www.i18next.com/) 来实现应用的多语言支持。
|
|
15
15
|
- **样式**:我们使用 [antd-style](https://github.com/ant-design/antd-style),这是一款与 Ant Design 配套的 CSS-in-JS 库。
|
|
16
|
-
- **单元测试**:我们使用 [vitest](https://github.com/
|
|
16
|
+
- **单元测试**:我们使用 [vitest](https://github.com/vitest-dev/vitest) 进行单元测试。
|
|
17
17
|
|
|
18
18
|
## 文件夹目录架构
|
|
19
19
|
|
|
@@ -274,7 +274,7 @@ If you want more people to use your plugin, you are welcome to submit it for rev
|
|
|
274
274
|
- **📘 Pluging SDK Docs**: <https://chat-plugin-sdk.lobehub.com>
|
|
275
275
|
- **🚀 chat-plugin-template**: <https://github.com/lobehub/chat-plugin-template>
|
|
276
276
|
- **🧩 chat-plugin-sdk**: <https://github.com/lobehub/chat-plugin-sdk>
|
|
277
|
-
- **🚪 chat-plugin-sdk**: <https://github.com/lobehub/chat-
|
|
277
|
+
- **🚪 chat-plugin-sdk**: <https://github.com/lobehub/chat-plugins-gateway>
|
|
278
278
|
- **🏪 lobe-chat-plugins**: <https://github.com/lobehub/lobe-chat-plugins>
|
|
279
279
|
|
|
280
280
|
<!-- LINK GROUP -->
|
|
@@ -273,7 +273,7 @@ export default Render;
|
|
|
273
273
|
- **📘 Pluging SDK 文档**: <https://chat-plugin-sdk.lobehub.com>
|
|
274
274
|
- **🚀 chat-plugin-template**: <https://github.com/lobehub/chat-plugin-template>
|
|
275
275
|
- **🧩 chat-plugin-sdk**: <https://github.com/lobehub/chat-plugin-sdk>
|
|
276
|
-
- **🚪 chat-plugin-gateway**: <https://github.com/lobehub/chat-
|
|
276
|
+
- **🚪 chat-plugin-gateway**: <https://github.com/lobehub/chat-plugins-gateway>
|
|
277
277
|
- **🏪 lobe-chat-plugins**: <https://github.com/lobehub/lobe-chat-plugins>
|
|
278
278
|
|
|
279
279
|
<!-- LINK GROUP -->
|
package/locales/zh_CN/chat.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.111.
|
|
3
|
+
"version": "0.111.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",
|
|
@@ -51,7 +51,7 @@ describe('chainSummaryTitle', () => {
|
|
|
51
51
|
role: 'user',
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
|
-
model: LanguageModel.
|
|
54
|
+
model: LanguageModel.GPT3_5_16K,
|
|
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
|
-
|
|
100
|
+
model: 'gpt-3.5-turbo-16k',
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
// Verify that getMessagesTokenCount was called with the correct messages
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ModelTokens } from '@/const/modelTokens';
|
|
2
1
|
import { chatHelpers } from '@/store/chat/helpers';
|
|
3
2
|
import { globalHelpers } from '@/store/global/helpers';
|
|
4
3
|
import { LanguageModel } from '@/types/llm';
|
|
@@ -21,11 +20,11 @@ export const chainSummaryTitle = async (
|
|
|
21
20
|
role: 'user',
|
|
22
21
|
},
|
|
23
22
|
];
|
|
24
|
-
// 如果超过
|
|
23
|
+
// 如果超过 4k,则使用 GPT3.5 16K 模型
|
|
25
24
|
const tokens = await chatHelpers.getMessagesTokenCount(finalMessages);
|
|
26
25
|
let model: LanguageModel | undefined = undefined;
|
|
27
|
-
if (tokens >
|
|
28
|
-
model = LanguageModel.
|
|
26
|
+
if (tokens > 4000) {
|
|
27
|
+
model = LanguageModel.GPT3_5_16K;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
return {
|
package/src/const/modelTokens.ts
CHANGED
|
@@ -2,7 +2,9 @@ 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]:
|
|
5
|
+
[LanguageModel.GPT3_5]: 4096,
|
|
6
|
+
[LanguageModel.GPT3_5_1106]: 16_385,
|
|
7
|
+
[LanguageModel.GPT3_5_16K]: 16_385,
|
|
6
8
|
[LanguageModel.GPT4]: 8196,
|
|
7
9
|
[LanguageModel.GPT4_PREVIEW]: 128_000,
|
|
8
10
|
[LanguageModel.GPT4_VISION_PREVIEW]: 128_000,
|
|
@@ -84,7 +84,7 @@ const AgentConfig = memo(() => {
|
|
|
84
84
|
valuePropName: 'checked',
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
children: <SliderWithInput max={32} min={
|
|
87
|
+
children: <SliderWithInput max={32} min={1} />,
|
|
88
88
|
desc: t('settingChat.historyCount.desc'),
|
|
89
89
|
divider: false,
|
|
90
90
|
hidden: !config.enableHistoryCount,
|
|
@@ -23,6 +23,14 @@ 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
|
+
},
|
|
26
34
|
{
|
|
27
35
|
"displayName": "gpt-4",
|
|
28
36
|
"name": "gpt-4",
|
|
@@ -48,6 +56,14 @@ exports[`settingsSelectors > CUSTOM_MODELS > only add the model 1`] = `
|
|
|
48
56
|
"displayName": "gpt-3.5-turbo",
|
|
49
57
|
"name": "gpt-3.5-turbo",
|
|
50
58
|
},
|
|
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
|
+
},
|
|
51
67
|
{
|
|
52
68
|
"displayName": "gpt-4",
|
|
53
69
|
"name": "gpt-4",
|