@lobehub/chat 1.14.0 → 1.14.1

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 1.14.1](https://github.com/lobehub/lobe-chat/compare/v1.14.0...v1.14.1)
6
+
7
+ <sup>Released on **2024-08-27**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Improve zhipu model config.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Improve zhipu model config, closes [#3635](https://github.com/lobehub/lobe-chat/issues/3635) ([1274e6a](https://github.com/lobehub/lobe-chat/commit/1274e6a))
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 1.14.0](https://github.com/lobehub/lobe-chat/compare/v1.13.2...v1.14.0)
6
31
 
7
32
  <sup>Released on **2024-08-27**</sup>
package/Dockerfile CHANGED
@@ -149,7 +149,7 @@ ENV \
149
149
  # 01.AI
150
150
  ZEROONE_API_KEY="" \
151
151
  # Zhipu
152
- ZHIPU_API_KEY=""
152
+ ZHIPU_API_KEY="" ZHIPU_MODEL_LIST=""
153
153
 
154
154
  USER nextjs
155
155
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
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",
package/src/config/llm.ts CHANGED
@@ -20,6 +20,7 @@ export const getLLMConfig = () => {
20
20
 
21
21
  ENABLED_ZHIPU: z.boolean(),
22
22
  ZHIPU_API_KEY: z.string().optional(),
23
+ ZHIPU_MODEL_LIST: z.string().optional(),
23
24
 
24
25
  ENABLED_DEEPSEEK: z.boolean(),
25
26
  DEEPSEEK_API_KEY: z.string().optional(),
@@ -109,6 +110,7 @@ export const getLLMConfig = () => {
109
110
 
110
111
  ENABLED_ZHIPU: !!process.env.ZHIPU_API_KEY,
111
112
  ZHIPU_API_KEY: process.env.ZHIPU_API_KEY,
113
+ ZHIPU_MODEL_LIST: process.env.ZHIPU_MODEL_LIST,
112
114
 
113
115
  ENABLED_DEEPSEEK: !!process.env.DEEPSEEK_API_KEY,
114
116
  DEEPSEEK_API_KEY: process.env.DEEPSEEK_API_KEY,
@@ -55,6 +55,8 @@ const ZhiPu: ModelProviderCard = {
55
55
  {
56
56
  description: '适用简单任务,速度最快,价格最实惠的版本',
57
57
  displayName: 'GLM-4-Flash',
58
+ enabled: true,
59
+ functionCall: true,
58
60
  id: 'glm-4-flash',
59
61
  tokens: 128_000,
60
62
  },
@@ -9,6 +9,7 @@ import {
9
9
  OpenRouterProviderCard,
10
10
  SiliconCloudProviderCard,
11
11
  TogetherAIProviderCard,
12
+ ZhiPuProviderCard,
12
13
  } from '@/config/modelProviders';
13
14
  import { enableNextAuth } from '@/const/auth';
14
15
  import { parseSystemAgent } from '@/server/globalConfig/parseSystemAgent';
@@ -26,6 +27,8 @@ export const getServerGlobalConfig = () => {
26
27
 
27
28
  ENABLED_MOONSHOT,
28
29
  ENABLED_ZHIPU,
30
+ ZHIPU_MODEL_LIST,
31
+
29
32
  ENABLED_AWS_BEDROCK,
30
33
  ENABLED_GOOGLE,
31
34
  ENABLED_GROQ,
@@ -136,7 +139,14 @@ export const getServerGlobalConfig = () => {
136
139
  }),
137
140
  },
138
141
  zeroone: { enabled: ENABLED_ZEROONE },
139
- zhipu: { enabled: ENABLED_ZHIPU },
142
+ zhipu: {
143
+ enabled: ENABLED_ZHIPU,
144
+ enabledModels: extractEnabledModels(ZHIPU_MODEL_LIST),
145
+ serverModelCards: transformToChatModelCards({
146
+ defaultChatModels: ZhiPuProviderCard.chatModels,
147
+ modelString: ZHIPU_MODEL_LIST
148
+ }),
149
+ },
140
150
  },
141
151
  oAuthSSOProviders: authEnv.NEXT_AUTH_SSO_PROVIDERS.trim().split(/[,,]/),
142
152
  systemAgent: parseSystemAgent(appEnv.SYSTEM_AGENT),