@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 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
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#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
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#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/vitejs/vitest) 进行单元测试。
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-plugin-gateway>
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-plugin-gateway>
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 -->
@@ -41,7 +41,7 @@
41
41
  "prettifying": "润色中..."
42
42
  },
43
43
  "temp": "临时",
44
- "tokenDetail": "角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}",
44
+ "tokenDetail": "角色设定: {{systemRoleToken}} · 会话消息: {{chatsToken}}",
45
45
  "tokenTag": {
46
46
  "overload": "超过限制",
47
47
  "remained": "剩余",
@@ -153,8 +153,8 @@
153
153
  "unlimited": "不限历史消息数"
154
154
  },
155
155
  "historyCount": {
156
- "desc": "每次请求携带的历史消息数",
157
- "title": "附带历史消息数"
156
+ "desc": "每次请求携带的消息数(包括最新编写的提问。每个提问和回答都计算1)",
157
+ "title": "附带消息数"
158
158
  },
159
159
  "inputTemplate": {
160
160
  "desc": "用户最新的一条消息会填充到此模板",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.111.2",
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.GPT4_PREVIEW,
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
- // No model specified since the token count is below the limit
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
- // 如果超过 16k,则使用 GPT-4-turbo 模型
23
+ // 如果超过 4k,则使用 GPT3.5 16K 模型
25
24
  const tokens = await chatHelpers.getMessagesTokenCount(finalMessages);
26
25
  let model: LanguageModel | undefined = undefined;
27
- if (tokens > ModelTokens[LanguageModel.GPT3_5]) {
28
- model = LanguageModel.GPT4_PREVIEW;
26
+ if (tokens > 4000) {
27
+ model = LanguageModel.GPT3_5_16K;
29
28
  }
30
29
 
31
30
  return {
@@ -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]: 16_385,
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={0} />,
87
+ children: <SliderWithInput max={32} min={1} />,
88
88
  desc: t('settingChat.historyCount.desc'),
89
89
  divider: false,
90
90
  hidden: !config.enableHistoryCount,
@@ -44,7 +44,7 @@ export default {
44
44
  prettifying: '润色中...',
45
45
  },
46
46
  temp: '临时',
47
- tokenDetail: '角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}',
47
+ tokenDetail: '角色设定: {{systemRoleToken}} · 会话消息: {{chatsToken}}',
48
48
  tokenTag: {
49
49
  overload: '超过限制',
50
50
  remained: '剩余',
@@ -153,8 +153,8 @@ export default {
153
153
  unlimited: '不限历史消息数',
154
154
  },
155
155
  historyCount: {
156
- desc: '每次请求携带的历史消息数',
157
- title: '附带历史消息数',
156
+ desc: '每次请求携带的消息数(包括最新编写的提问。每个提问和回答都计算1)',
157
+ title: '附带消息数',
158
158
  },
159
159
  inputTemplate: {
160
160
  desc: '用户最新的一条消息会填充到此模板',
@@ -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",
package/src/types/llm.ts CHANGED
@@ -6,6 +6,8 @@ export enum LanguageModel {
6
6
  * GPT 3.5 Turbo
7
7
  */
8
8
  GPT3_5 = 'gpt-3.5-turbo',
9
+ GPT3_5_1106 = 'gpt-3.5-turbo-1106',
10
+ GPT3_5_16K = 'gpt-3.5-turbo-16k',
9
11
  /**
10
12
  * GPT 4
11
13
  */