@lobehub/chat 0.110.7 → 0.110.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,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 0.110.8](https://github.com/lobehub/lobe-chat/compare/v0.110.7...v0.110.8)
6
+
7
+ <sup>Released on **2023-12-12**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: 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**: 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))
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
+
5
30
  ### [Version 0.110.7](https://github.com/lobehub/lobe-chat/compare/v0.110.6...v0.110.7)
6
31
 
7
32
  <sup>Released on **2023-12-11**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.110.7",
3
+ "version": "0.110.8",
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",
@@ -51,7 +51,7 @@ describe('chainSummaryTitle', () => {
51
51
  role: 'user',
52
52
  },
53
53
  ],
54
- model: LanguageModel.GPT3_5_16K,
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: 'gpt-3.5-turbo-16k',
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
- // 如果超过 4k,则使用 GPT3.5 16K 模型
24
+ // 如果超过 16k,则使用 GPT-4-turbo 模型
24
25
  const tokens = await chatHelpers.getMessagesTokenCount(finalMessages);
25
26
  let model: LanguageModel | undefined = undefined;
26
- if (tokens > 4000) {
27
- model = LanguageModel.GPT3_5_16K;
27
+ if (tokens > ModelTokens[LanguageModel.GPT3_5]) {
28
+ model = LanguageModel.GPT4_PREVIEW;
28
29
  }
29
30
 
30
31
  return {
@@ -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]: 4096,
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",
package/src/types/llm.ts CHANGED
@@ -6,8 +6,6 @@ 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',
11
9
  /**
12
10
  * GPT 4
13
11
  */