@lobehub/chat 1.73.0 → 1.73.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.73.1](https://github.com/lobehub/lobe-chat/compare/v1.73.0...v1.73.1)
6
+
7
+ <sup>Released on **2025-03-21**</sup>
8
+
9
+ #### 💄 Styles
10
+
11
+ - **misc**: Update shiki to v3.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### Styles
19
+
20
+ - **misc**: Update shiki to v3, closes [#7069](https://github.com/lobehub/lobe-chat/issues/7069) ([03c95ab](https://github.com/lobehub/lobe-chat/commit/03c95ab))
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.73.0](https://github.com/lobehub/lobe-chat/compare/v1.72.1...v1.73.0)
6
31
 
7
32
  <sup>Released on **2025-03-19**</sup>
package/changelog/v1.json CHANGED
@@ -1,4 +1,13 @@
1
1
  [
2
+ {
3
+ "children": {
4
+ "improvements": [
5
+ "Update shiki to v3."
6
+ ]
7
+ },
8
+ "date": "2025-03-21",
9
+ "version": "1.73.1"
10
+ },
2
11
  {
3
12
  "children": {
4
13
  "features": [
@@ -173,8 +173,8 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
173
173
 
174
174
  - Type: Optional
175
175
  - Description: If you manually configure the DeepSeek API proxy, you can use this configuration item to override the default DeepSeek API request base URL
176
- - Default: -
177
- - Example: `https://xxxx.models.ai.azure.com/v1`
176
+ - Default: `https://api.deepseek.com`
177
+ - Example: `https://my-deepseek-proxy.com`
178
178
 
179
179
  ### `DEEPSEEK_API_KEY`
180
180
 
@@ -320,6 +320,13 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
320
320
  - Default: -
321
321
  - Example: `Y2xpdGhpMzNhZXNoYjVtdnZjMWc6bXNrLWIxQlk3aDNPaXpBWnc0V1RaMDhSRmRFVlpZUWY=`
322
322
 
323
+ ### `MOONSHOT_PROXY_URL`
324
+
325
+ - Type: Optional
326
+ - Description: If you manually configure the Moonshot API proxy, you can use this configuration item to override the default Moonshot API request base URL
327
+ - Default: `https://api.moonshot.cn/v1`
328
+ - Example: `https://my-moonshot-proxy.com/v1`
329
+
323
330
  ## Perplexity AI
324
331
 
325
332
  ### `PERPLEXITY_API_KEY`
@@ -575,3 +582,10 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
575
582
 
576
583
 
577
584
  [model-list]: /docs/self-hosting/advanced/model-list
585
+
586
+ ### `VOLCENGINE_PROXY_URL`
587
+
588
+ - Type: Optional
589
+ - Description: If you manually configure the Volcengine API proxy, you can use this configuration item to override the default Volcengine API request base URL
590
+ - Default: `https://ark.cn-beijing.volces.com/api/v3`
591
+ - Example: `https://my-volcengine-proxy.com/v1`
@@ -171,8 +171,8 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
171
171
 
172
172
  - 类型:可选
173
173
  - 描述:如果您手动配置了 DeepSeek API 代理,可以使用此配置项覆盖默认的 DeepSeek API 请求基础 URL
174
- - 默认值: -
175
- - 示例: `https://xxxx.models.ai.azure.com/v1`
174
+ - 默认值:`https://api.deepseek.com`
175
+ - 示例:`https://my-deepseek-proxy.com`
176
176
 
177
177
  ### `DEEPSEEK_API_KEY`
178
178
 
@@ -318,6 +318,14 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
318
318
  - 默认值:-
319
319
  - 示例:`Y2xpdGhpMzNhZXNoYjVtdnZjMWc6bXNrLWIxQlk3aDNPaXpBWnc0V1RaMDhSRmRFVlpZUWY=`
320
320
 
321
+ ### `MOONSHOT_PROXY_URL`
322
+
323
+ - 类型:可选
324
+ - 描述:如果你手动配置了 Moonshot 接口代理,可以使用此配置项来覆盖默认的 Moonshot API 请求基础 URL
325
+ - 默认值:`https://api.moonshot.cn/v1`
326
+ - 示例:`https://my-moonshot-proxy.com/v1`
327
+
328
+
321
329
  ## Perplexity AI
322
330
 
323
331
  ### `PERPLEXITY_API_KEY`
@@ -572,3 +580,10 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
572
580
  - 示例:`-all,+deepseek-r1->deepseek-r1-250120,+deepseek-v3->deepseek-v3-241226,+doubao-1.5-pro-256k->doubao-1-5-pro-256k-250115,+doubao-1.5-pro-32k->doubao-1-5-pro-32k-250115,+doubao-1.5-lite-32k->doubao-1-5-lite-32k-250115`
573
581
 
574
582
  [model-list]: /zh/docs/self-hosting/advanced/model-list
583
+
584
+ ### `VOLCENGINE_PROXY_URL`
585
+
586
+ - 类型:可选
587
+ - 描述:如果你手动配置了 Volcengine 接口代理,可以使用此配置项来覆盖默认的 Volcengine API 请求基础 URL
588
+ - 默认值:`https://ark.cn-beijing.volces.com/api/v3`
589
+ - 示例:`https://my-volcengine-proxy.com/v1`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.73.0",
3
+ "version": "1.73.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",
@@ -135,7 +135,7 @@
135
135
  "@lobehub/chat-plugins-gateway": "^1.9.0",
136
136
  "@lobehub/icons": "^1.73.1",
137
137
  "@lobehub/tts": "^1.28.0",
138
- "@lobehub/ui": "^1.165.5",
138
+ "@lobehub/ui": "^1.165.8",
139
139
  "@neondatabase/serverless": "^0.10.4",
140
140
  "@next/third-parties": "^15.2.0",
141
141
  "@react-spring/web": "^9.7.5",
@@ -229,7 +229,7 @@
229
229
  "rtl-detect": "^1.1.2",
230
230
  "semver": "^7.6.3",
231
231
  "sharp": "^0.33.5",
232
- "shiki": "^1.26.1",
232
+ "shiki": "^3.2.1",
233
233
  "stripe": "^16.12.0",
234
234
  "superjson": "^2.2.2",
235
235
  "svix": "^1.59.1",
@@ -0,0 +1,63 @@
1
+ import { describe, expect, it, vi } from 'vitest';
2
+
3
+ import { TimeoutError } from '../errorType';
4
+ import { DEFAULT_TIMEOUT, withTimeout } from '../withTimeout';
5
+
6
+ describe('withTimeout', () => {
7
+ beforeEach(() => {
8
+ vi.useFakeTimers();
9
+ });
10
+
11
+ afterEach(() => {
12
+ vi.useRealTimers();
13
+ });
14
+
15
+ it('should resolve when promise resolves before timeout', async () => {
16
+ const promise = Promise.resolve('success');
17
+ const result = await withTimeout(promise, 1000);
18
+ expect(result).toBe('success');
19
+ });
20
+
21
+ it('should reject with TimeoutError when promise takes too long', async () => {
22
+ const slowPromise = new Promise((resolve) => {
23
+ setTimeout(() => resolve('too late'), 200);
24
+ });
25
+
26
+ const timeoutPromise = withTimeout(slowPromise, 100);
27
+ vi.advanceTimersByTime(100);
28
+
29
+ await expect(timeoutPromise).rejects.toThrow(TimeoutError);
30
+ await expect(timeoutPromise).rejects.toThrow('Request timeout after 100ms');
31
+ });
32
+
33
+ it('should use DEFAULT_TIMEOUT when no timeout specified', async () => {
34
+ const slowPromise = new Promise((resolve) => {
35
+ setTimeout(() => resolve('success'), DEFAULT_TIMEOUT + 100);
36
+ });
37
+
38
+ const timeoutPromise = withTimeout(slowPromise);
39
+ vi.advanceTimersByTime(DEFAULT_TIMEOUT);
40
+
41
+ await expect(timeoutPromise).rejects.toThrow(TimeoutError);
42
+ await expect(timeoutPromise).rejects.toThrow(`Request timeout after ${DEFAULT_TIMEOUT}ms`);
43
+ });
44
+
45
+ it('should reject with original error if promise rejects before timeout', async () => {
46
+ const error = new Error('Original error');
47
+ const failingPromise = Promise.reject(error);
48
+
49
+ await expect(withTimeout(failingPromise, 1000)).rejects.toThrow('Original error');
50
+ });
51
+
52
+ it('should abort controller when timeout occurs', async () => {
53
+ const controller = new AbortController();
54
+ const slowPromise = new Promise((resolve) => {
55
+ setTimeout(() => resolve('too late'), 2000);
56
+ });
57
+
58
+ const timeoutPromise = withTimeout(slowPromise, 1000);
59
+ vi.advanceTimersByTime(1000);
60
+
61
+ await expect(timeoutPromise).rejects.toThrow(TimeoutError);
62
+ });
63
+ });