@lobehub/chat 0.97.0 → 0.98.0

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.98.0](https://github.com/lobehub/lobe-chat/compare/v0.97.1...v0.98.0)
6
+
7
+ <sup>Released on **2023-11-07**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: Support latest openai model.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's improved
19
+
20
+ - **misc**: Support latest openai model, closes [#417](https://github.com/lobehub/lobe-chat/issues/417) ([46386dc](https://github.com/lobehub/lobe-chat/commit/46386dc))
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.97.1](https://github.com/lobehub/lobe-chat/compare/v0.97.0...v0.97.1)
31
+
32
+ <sup>Released on **2023-11-06**</sup>
33
+
34
+ #### 🐛 Bug Fixes
35
+
36
+ - **misc**: Use pnpm to fix docker release.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### What's fixed
44
+
45
+ - **misc**: Use pnpm to fix docker release ([886cc3b](https://github.com/lobehub/lobe-chat/commit/886cc3b))
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.97.0](https://github.com/lobehub/lobe-chat/compare/v0.96.9...v0.97.0)
6
56
 
7
57
  <sup>Released on **2023-11-05**</sup>
package/Dockerfile CHANGED
@@ -10,10 +10,9 @@ WORKDIR /app
10
10
 
11
11
  COPY package.json ./
12
12
 
13
- RUN pnpm i -g bun
14
13
  # If you want to build docker in China
15
14
  #RUN npm config set registry https://registry.npmmirror.com/
16
- RUN bun i
15
+ RUN pnpm i
17
16
 
18
17
  COPY . .
19
18
  RUN pnpm run build:docker # run build standalone for docker version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.97.0",
3
+ "version": "0.98.0",
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",
@@ -93,7 +93,7 @@
93
93
  "modern-screenshot": "^4",
94
94
  "nanoid": "^5",
95
95
  "next": "^13.5.3",
96
- "openai": "^4.10.0",
96
+ "openai": "~4.15.0",
97
97
  "polished": "^4",
98
98
  "posthog-js": "^1",
99
99
  "query-string": "^8",
package/src/const/llm.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { LanguageModel } from '@/types/llm';
2
+
1
3
  /**
2
4
  * A white list of language models that are allowed to display and be used in the app.
3
5
  */
@@ -9,9 +11,4 @@ export const LanguageModelWhiteList = [
9
11
  'gpt-4-32k',
10
12
  ];
11
13
 
12
- export const DEFAULT_OPENAI_MODEL_LIST = [
13
- 'gpt-3.5-turbo',
14
- 'gpt-3.5-turbo-16k',
15
- 'gpt-4',
16
- 'gpt-4-32k',
17
- ];
14
+ export const DEFAULT_OPENAI_MODEL_LIST: string[] = Object.values(LanguageModel);
@@ -1,8 +1,12 @@
1
1
  import { LanguageModel } from '@/types/llm';
2
2
 
3
+ // refs to: https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo
3
4
  export const ModelTokens: Record<LanguageModel, number> = {
4
5
  [LanguageModel.GPT3_5]: 4096,
5
- [LanguageModel.GPT3_5_16K]: 4096 * 4,
6
+ [LanguageModel.GPT3_5_1106]: 16_385,
7
+ [LanguageModel.GPT3_5_16K]: 16_385,
6
8
  [LanguageModel.GPT4]: 8196,
7
- [LanguageModel.GPT4_32K]: 8196 * 4,
9
+ [LanguageModel.GPT4_PREVIEW]: 128_000,
10
+ [LanguageModel.GPT4_VISION_PREVIEW]: 128_000,
11
+ [LanguageModel.GPT4_32K]: 32_768,
8
12
  };
package/src/types/llm.ts CHANGED
@@ -6,12 +6,15 @@ 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',
9
10
  GPT3_5_16K = 'gpt-3.5-turbo-16k',
10
11
  /**
11
12
  * GPT 4
12
13
  */
13
14
  GPT4 = 'gpt-4',
14
15
  GPT4_32K = 'gpt-4-32k',
16
+ GPT4_PREVIEW = 'gpt-4-1106-preview',
17
+ GPT4_VISION_PREVIEW = 'gpt-4-vision-preview',
15
18
  }
16
19
 
17
20
  // 语言模型的设置参数