@lobehub/chat 1.52.14 → 1.52.16
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 +58 -0
- package/changelog/v1.json +21 -0
- package/docker-compose/local/docker-compose.yml +24 -0
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +2 -2
- package/package.json +1 -1
- package/src/components/MaxTokenSlider.tsx +10 -9
- package/src/config/modelProviders/mistral.ts +3 -0
- package/src/libs/agent-runtime/lmstudio/index.test.ts +1 -1
- package/src/libs/agent-runtime/lmstudio/index.ts +1 -1
- package/src/utils/client/switchLang.test.ts +8 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,64 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.52.16](https://github.com/lobehub/lobe-chat/compare/v1.52.15...v1.52.16)
|
6
|
+
|
7
|
+
<sup>Released on **2025-02-11**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Support mistral proxy url.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Support mistral proxy url, closes [#6002](https://github.com/lobehub/lobe-chat/issues/6002) ([dcb465e](https://github.com/lobehub/lobe-chat/commit/dcb465e))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.52.15](https://github.com/lobehub/lobe-chat/compare/v1.52.14...v1.52.15)
|
31
|
+
|
32
|
+
<sup>Released on **2025-02-10**</sup>
|
33
|
+
|
34
|
+
#### 🐛 Bug Fixes
|
35
|
+
|
36
|
+
- **misc**: Fix lmstudio baseURL.
|
37
|
+
|
38
|
+
#### 💄 Styles
|
39
|
+
|
40
|
+
- **misc**: Optimized MaxToken Slider.
|
41
|
+
|
42
|
+
<br/>
|
43
|
+
|
44
|
+
<details>
|
45
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
46
|
+
|
47
|
+
#### What's fixed
|
48
|
+
|
49
|
+
- **misc**: Fix lmstudio baseURL, closes [#5988](https://github.com/lobehub/lobe-chat/issues/5988) ([1d19aa6](https://github.com/lobehub/lobe-chat/commit/1d19aa6))
|
50
|
+
|
51
|
+
#### Styles
|
52
|
+
|
53
|
+
- **misc**: Optimized MaxToken Slider, closes [#5952](https://github.com/lobehub/lobe-chat/issues/5952) ([3cdcb95](https://github.com/lobehub/lobe-chat/commit/3cdcb95))
|
54
|
+
|
55
|
+
</details>
|
56
|
+
|
57
|
+
<div align="right">
|
58
|
+
|
59
|
+
[](#readme-top)
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
5
63
|
### [Version 1.52.14](https://github.com/lobehub/lobe-chat/compare/v1.52.13...v1.52.14)
|
6
64
|
|
7
65
|
<sup>Released on **2025-02-10**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,25 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Support mistral proxy url."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-02-11",
|
9
|
+
"version": "1.52.16"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"fixes": [
|
14
|
+
"Fix lmstudio baseURL."
|
15
|
+
],
|
16
|
+
"improvements": [
|
17
|
+
"Optimized MaxToken Slider."
|
18
|
+
]
|
19
|
+
},
|
20
|
+
"date": "2025-02-10",
|
21
|
+
"version": "1.52.15"
|
22
|
+
},
|
2
23
|
{
|
3
24
|
"children": {
|
4
25
|
"improvements": [
|
@@ -103,6 +103,30 @@ services:
|
|
103
103
|
env_file:
|
104
104
|
- .env
|
105
105
|
restart: always
|
106
|
+
entrypoint: >
|
107
|
+
/bin/sh -c "
|
108
|
+
/bin/node /app/startServer.js &
|
109
|
+
LOBE_PID=\$!
|
110
|
+
sleep 3
|
111
|
+
if [ $(wget --timeout=5 --spider --server-response ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep -c 'HTTP/1.1 200 OK') -eq 0 ]; then
|
112
|
+
echo '⚠️Warining: Unable to fetch OIDC configuration from Casdoor'
|
113
|
+
echo 'Request URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration'
|
114
|
+
echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration'
|
115
|
+
else
|
116
|
+
if ! wget -O - --timeout=5 ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep 'issuer' | grep ${AUTH_CASDOOR_ISSUER}; then
|
117
|
+
printf '❌Error: The Auth issuer is conflict, Issuer in OIDC configuration is: %s' \$(wget -O - --timeout=5 ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration 2>&1 | grep -E 'issuer.*' | awk -F '\"' '{print \$4}')
|
118
|
+
echo ' , but the issuer in .env file is: ${AUTH_CASDOOR_ISSUER} '
|
119
|
+
echo 'Request URL: ${AUTH_CASDOOR_ISSUER}/.well-known/openid-configuration'
|
120
|
+
echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration'
|
121
|
+
fi
|
122
|
+
fi
|
123
|
+
if [ $(wget --timeout=5 --spider --server-response ${S3_ENDPOINT}/minio/health/live 2>&1 | grep -c 'HTTP/1.1 200 OK') -eq 0 ]; then
|
124
|
+
echo '⚠️Warining: Unable to fetch MinIO health status'
|
125
|
+
echo 'Request URL: ${S3_ENDPOINT}/minio/health/live'
|
126
|
+
echo 'Read more at: https://lobehub.com/docs/self-hosting/server-database/docker-compose#necessary-configuration'
|
127
|
+
fi
|
128
|
+
wait \$LOBE_PID
|
129
|
+
"
|
106
130
|
|
107
131
|
volumes:
|
108
132
|
data:
|
@@ -107,13 +107,13 @@ If you are deploying using a public network, the following assumptions apply:
|
|
107
107
|
|
108
108
|
Configure the Casdoor webhook so that LobeChat can receive notifications when user information is updated.
|
109
109
|
|
110
|
-
Go to `Admin
|
110
|
+
Go to `Admin` -> `Webhooks`, add a webhook, and fill in the following fields:
|
111
111
|
|
112
112
|
- URL: `https://lobe.example.com/api/auth/webhooks/casdoor`
|
113
113
|
- Method: `POST`
|
114
114
|
- Content Type: `application/json`
|
115
115
|
- Headers: `casdoor-secret`: `Your Webhook Secret`
|
116
|
-
> The
|
116
|
+
> The secret is generated by yourself, you can visit https://generate-secret.vercel.app/10 to generate a 10 bit secret.
|
117
117
|
|
118
118
|
- Event: `update-user`
|
119
119
|
- Is user extented: `true`
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.52.
|
3
|
+
"version": "1.52.16",
|
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",
|
@@ -35,7 +35,7 @@ const MaxTokenSlider = memo<MaxTokenSliderProps>(({ value, onChange, defaultValu
|
|
35
35
|
const updateWithPowValue = (value: number) => {
|
36
36
|
setPowValue(value);
|
37
37
|
|
38
|
-
setTokens(getRealValue(value)
|
38
|
+
setTokens(getRealValue(value) <= 2 ? 0 : powerKibi(value));
|
39
39
|
};
|
40
40
|
|
41
41
|
const updateWithRealValue = (value: number) => {
|
@@ -48,16 +48,16 @@ const MaxTokenSlider = memo<MaxTokenSliderProps>(({ value, onChange, defaultValu
|
|
48
48
|
|
49
49
|
const marks = useMemo(() => {
|
50
50
|
return {
|
51
|
-
[exponent(
|
52
|
-
[exponent(
|
53
|
-
[exponent(4)]: isMobile ? '4' : '4K',
|
51
|
+
[exponent(2)]: '0',
|
52
|
+
[exponent(4)]: isMobile ? '4' : '4K', // 4 Kibi = 4096
|
54
53
|
[exponent(8)]: isMobile ? '8' : '8K',
|
55
54
|
[exponent(16)]: isMobile ? '16' : '16K',
|
56
55
|
[exponent(32)]: isMobile ? '32' : '32K',
|
57
56
|
[exponent(64)]: isMobile ? '64' : '64K',
|
58
57
|
[exponent((128 / Kibi) * 1000)]: ' ', // hide tick mark
|
59
58
|
[exponent((200 / Kibi) * 1000)]: isMobile ? '200' : '200k', // 200,000
|
60
|
-
[exponent(Kibi)]:
|
59
|
+
[exponent(Kibi)]: '1M',
|
60
|
+
[exponent(2 * Kibi)]: '2M',
|
61
61
|
};
|
62
62
|
}, [isMobile]);
|
63
63
|
|
@@ -66,14 +66,14 @@ const MaxTokenSlider = memo<MaxTokenSliderProps>(({ value, onChange, defaultValu
|
|
66
66
|
<Flexbox flex={1}>
|
67
67
|
<Slider
|
68
68
|
marks={marks}
|
69
|
-
max={exponent(Kibi)}
|
70
|
-
min={
|
69
|
+
max={exponent(2 * Kibi)}
|
70
|
+
min={exponent(2)}
|
71
71
|
onChange={updateWithPowValue}
|
72
72
|
step={null}
|
73
73
|
tooltip={{
|
74
74
|
formatter: (x) => {
|
75
75
|
if (typeof x === 'undefined') return;
|
76
|
-
if (x
|
76
|
+
if (x <= exponent(2)) return t('MaxTokenSlider.unlimited');
|
77
77
|
|
78
78
|
let value = getRealValue(x);
|
79
79
|
if (value < 125) return value.toFixed(0) + 'K';
|
@@ -86,13 +86,14 @@ const MaxTokenSlider = memo<MaxTokenSliderProps>(({ value, onChange, defaultValu
|
|
86
86
|
</Flexbox>
|
87
87
|
<div>
|
88
88
|
<InputNumber
|
89
|
+
changeOnWheel
|
89
90
|
min={0}
|
90
91
|
onChange={(e) => {
|
91
92
|
if (!e && e !== 0) return;
|
92
93
|
|
93
94
|
updateWithRealValue(e);
|
94
95
|
}}
|
95
|
-
step={
|
96
|
+
step={4 * Kibi}
|
96
97
|
value={token}
|
97
98
|
/>
|
98
99
|
</div>
|
@@ -154,6 +154,9 @@ const Mistral: ModelProviderCard = {
|
|
154
154
|
modelsUrl: 'https://docs.mistral.ai/getting-started/models',
|
155
155
|
name: 'Mistral',
|
156
156
|
settings: {
|
157
|
+
proxyUrl: {
|
158
|
+
placeholder: 'https://api.mistral.ai',
|
159
|
+
},
|
157
160
|
sdkType: 'openai',
|
158
161
|
showModelFetcher: true,
|
159
162
|
},
|
@@ -12,7 +12,7 @@ import * as debugStreamModule from '../utils/debugStream';
|
|
12
12
|
import { LobeLMStudioAI } from './index';
|
13
13
|
|
14
14
|
const provider = ModelProvider.LMStudio;
|
15
|
-
const defaultBaseURL = 'http://
|
15
|
+
const defaultBaseURL = 'http://127.0.0.1:1234/v1';
|
16
16
|
|
17
17
|
const bizErrorType = 'ProviderBizError';
|
18
18
|
const invalidErrorType = 'InvalidProviderAPIKey';
|
@@ -3,7 +3,7 @@ import { LobeOpenAICompatibleFactory } from '../utils/openaiCompatibleFactory';
|
|
3
3
|
|
4
4
|
export const LobeLMStudioAI = LobeOpenAICompatibleFactory({
|
5
5
|
apiKey: 'placeholder-to-avoid-error',
|
6
|
-
baseURL: 'http://
|
6
|
+
baseURL: 'http://127.0.0.1:1234/v1',
|
7
7
|
debug: {
|
8
8
|
chatCompletion: () => process.env.DEBUG_LMSTUDIO_CHAT_COMPLETION === '1',
|
9
9
|
},
|
@@ -1,7 +1,9 @@
|
|
1
1
|
import { changeLanguage } from 'i18next';
|
2
2
|
import { describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
+
import { LOBE_LOCALE_COOKIE } from '@/const/locale';
|
4
5
|
import { LocaleMode } from '@/types/locale';
|
6
|
+
import { setCookie } from '@/utils/client/cookie';
|
5
7
|
|
6
8
|
import { switchLang } from './switchLang';
|
7
9
|
|
@@ -9,6 +11,10 @@ vi.mock('i18next', () => ({
|
|
9
11
|
changeLanguage: vi.fn(),
|
10
12
|
}));
|
11
13
|
|
14
|
+
vi.mock('./cookie', () => ({
|
15
|
+
setCookie: vi.fn(),
|
16
|
+
}));
|
17
|
+
|
12
18
|
describe('switchLang', () => {
|
13
19
|
afterEach(() => {
|
14
20
|
vi.resetAllMocks();
|
@@ -20,6 +26,7 @@ describe('switchLang', () => {
|
|
20
26
|
|
21
27
|
expect(changeLanguage).toHaveBeenCalledWith(locale);
|
22
28
|
expect(document.documentElement.lang).toBe(locale);
|
29
|
+
expect(setCookie).toHaveBeenCalledWith(LOBE_LOCALE_COOKIE, locale, 365);
|
23
30
|
});
|
24
31
|
|
25
32
|
it('should change language based on navigator.language when locale is "auto"', () => {
|
@@ -30,5 +37,6 @@ describe('switchLang', () => {
|
|
30
37
|
|
31
38
|
expect(changeLanguage).toHaveBeenCalledWith(navigatorLanguage);
|
32
39
|
expect(document.documentElement.lang).toBe(navigatorLanguage);
|
40
|
+
expect(setCookie).toHaveBeenCalledWith(LOBE_LOCALE_COOKIE, undefined, 365);
|
33
41
|
});
|
34
42
|
});
|