@lobehub/chat 0.111.3 β 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,31 @@
|
|
|
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
|
+
|
|
5
30
|
### [Version 0.111.3](https://github.com/lobehub/lobe-chat/compare/v0.111.2...v0.111.3)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-12-14**</sup>
|
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,
|
|
@@ -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",
|