@lobehub/chat 1.22.5 → 1.22.7
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/.env.example +3 -3
- package/CHANGELOG.md +50 -0
- package/README.md +8 -8
- package/README.zh-CN.md +8 -8
- package/docker-compose/local/logto/.env.example +3 -2
- package/docker-compose/local/logto/.env.zh-CN.example +3 -2
- package/docker-compose/production/logto/.env.example +2 -2
- package/docker-compose/production/logto/.env.zh-CN.example +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +4 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +2 -3
- package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +3 -4
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +1 -1
- package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +1 -1
- package/docs/self-hosting/environment-variables/auth.mdx +21 -21
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +22 -22
- package/docs/self-hosting/server-database/docker-compose.mdx +5 -4
- package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +2 -3
- package/docs/self-hosting/server-database/docker.mdx +6 -6
- package/docs/self-hosting/server-database/docker.zh-CN.mdx +6 -6
- package/docs/self-hosting/server-database/zeabur.mdx +1 -4
- package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +1 -1
- package/package.json +1 -1
- package/src/config/modelProviders/huggingface.ts +0 -20
- package/src/config/modelProviders/siliconcloud.ts +63 -1
- package/src/features/Conversation/components/SkeletonList.tsx +1 -1
- package/src/store/chat/slices/aiChat/action.ts +25 -20
- package/src/store/chat/slices/message/action.ts +1 -0
- package/src/store/chat/utils/index.ts +1 -1
package/.env.example
CHANGED
@@ -176,9 +176,9 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
|
176
176
|
# NEXT_AUTH_SECRET=
|
177
177
|
|
178
178
|
# Auth0 configurations
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
179
|
+
# AUTH_AUTH0_ID=
|
180
|
+
# AUTH_AUTH0_SECRET=
|
181
|
+
# AUTH_AUTH0_ISSUER=https://your-domain.auth0.com
|
182
182
|
|
183
183
|
########################################
|
184
184
|
########## Server Database #############
|
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.22.7](https://github.com/lobehub/lobe-chat/compare/v1.22.6...v1.22.7)
|
6
|
+
|
7
|
+
<sup>Released on **2024-10-17**</sup>
|
8
|
+
|
9
|
+
#### 💄 Styles
|
10
|
+
|
11
|
+
- **misc**: Add qwen vision model & update qwen2.5 72b to 128k for siliconcloud.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### Styles
|
19
|
+
|
20
|
+
- **misc**: Add qwen vision model & update qwen2.5 72b to 128k for siliconcloud, closes [#4380](https://github.com/lobehub/lobe-chat/issues/4380) ([e8c009b](https://github.com/lobehub/lobe-chat/commit/e8c009b))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.22.6](https://github.com/lobehub/lobe-chat/compare/v1.22.5...v1.22.6)
|
31
|
+
|
32
|
+
<sup>Released on **2024-10-13**</sup>
|
33
|
+
|
34
|
+
#### 🐛 Bug Fixes
|
35
|
+
|
36
|
+
- **misc**: Fix images not go in to chat context.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### What's fixed
|
44
|
+
|
45
|
+
- **misc**: Fix images not go in to chat context, closes [#4361](https://github.com/lobehub/lobe-chat/issues/4361) ([f17ab49](https://github.com/lobehub/lobe-chat/commit/f17ab49))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.22.5](https://github.com/lobehub/lobe-chat/compare/v1.22.4...v1.22.5)
|
6
56
|
|
7
57
|
<sup>Released on **2024-10-13**</sup>
|
package/README.md
CHANGED
@@ -152,7 +152,7 @@ We have implemented support for the following model service providers:
|
|
152
152
|
- **Moonshot AI (Dark Side of the Moon)**: Integrated with the Moonshot series models, an innovative AI startup from China, aiming to provide deeper conversation understanding. [Learn more](https://www.moonshot.cn/)
|
153
153
|
- **Minimax**: Integrated the Minimax models, including the MoE model **abab6**, offers a broader range of choices. [Learn more](https://www.minimaxi.com/)
|
154
154
|
- **DeepSeek**: Integrated with the DeepSeek series models, an innovative AI startup from China, The product has been designed to provide a model that balances performance with price. [Learn more](https://www.deepseek.com/)
|
155
|
-
- **Qwen**: Integrated the Qwen series models, including the latest **qwen-turbo**, **qwen-plus** and **qwen-max**. [
|
155
|
+
- **Qwen**: Integrated the Qwen series models, including the latest **qwen-turbo**, **qwen-plus** and **qwen-max**. [Learn more](https://help.aliyun.com/zh/dashscope/developer-reference/model-introduction)
|
156
156
|
- **Novita AI**: Access **Llama**, **Mistral**, and other leading open-source models at cheapest prices. Engage in uncensored role-play, spark creative discussions, and foster unrestricted innovation. **Pay For What You Use.** [Learn more](https://novita.ai/llm-api?utm_source=lobechat&utm_medium=ch&utm_campaign=api)
|
157
157
|
|
158
158
|
At the same time, we are also planning to support more model service providers, such as Replicate and Perplexity, to further enrich our service provider library. If you would like LobeChat to support your favorite service provider, feel free to join our [community discussion](https://github.com/lobehub/lobe-chat/discussions/1284).
|
@@ -285,14 +285,14 @@ Our marketplace is not just a showcase platform but also a collaborative space.
|
|
285
285
|
|
286
286
|
<!-- AGENT LIST -->
|
287
287
|
|
288
|
-
| Recent Submits
|
289
|
-
|
|
290
|
-
| [
|
291
|
-
| [
|
292
|
-
| [
|
293
|
-
| [
|
288
|
+
| Recent Submits | Description |
|
289
|
+
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
290
|
+
| [Boxing Training Master](https://chat-preview.lobehub.com/market?agent=boxing-master)<br/><sup>By **[Luyi-2333](https://github.com/Luyi-2333)** on **2024-10-15**</sup> | Expert in boxing training guidance and personalized plan development<br/>`boxing-training` `personalized-plans` `fitness-guidance` `progress-evaluation` `technique-improvement` `health-and-nutrition` |
|
291
|
+
| [Coconut](https://chat-preview.lobehub.com/market?agent=deep-thinker-ai)<br/><sup>By **[hia1234](https://github.com/hia1234)** on **2024-10-15**</sup> | A chatbot that undergoes several reviews of its responses, checking whether there is a basis for its statements and actively requesting feedback while engaging in repeated interactions.<br/>`programming` `general` |
|
292
|
+
| [GitHub Project Documentation Assistant](https://chat-preview.lobehub.com/market?agent=github-doc-asst)<br/><sup>By **[Luyi-2333](https://github.com/Luyi-2333)** on **2024-10-14**</sup> | Focused on writing and optimizing documentation for open source projects<br/>`documentation-optimization` `open-source-projects` `writing-techniques` `git-hub` |
|
293
|
+
| [Ophthalmologist](https://chat-preview.lobehub.com/market?agent=ophthalmologist)<br/><sup>By **[yuphone](https://github.com/yuphone)** on **2024-10-14**</sup> | Specializes in ophthalmic diagnosis and treatment recommendations<br/>`healthcare` `ophthalmology` `diagnosis` `recommendations` `professional` |
|
294
294
|
|
295
|
-
> 📊 Total agents: [<kbd>**
|
295
|
+
> 📊 Total agents: [<kbd>**418**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
296
296
|
|
297
297
|
<!-- AGENT LIST -->
|
298
298
|
|
package/README.zh-CN.md
CHANGED
@@ -273,14 +273,14 @@ LobeChat 的插件生态系统是其核心功能的重要扩展,它极大地
|
|
273
273
|
|
274
274
|
<!-- AGENT LIST -->
|
275
275
|
|
276
|
-
| 最近新增
|
277
|
-
|
|
278
|
-
| [
|
279
|
-
| [
|
280
|
-
| [
|
281
|
-
| [
|
282
|
-
|
283
|
-
> 📊 Total agents: [<kbd>**
|
276
|
+
| 最近新增 | 助手说明 |
|
277
|
+
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
278
|
+
| [拳击训练大师](https://chat-preview.lobehub.com/market?agent=boxing-master)<br/><sup>By **[Luyi-2333](https://github.com/Luyi-2333)** on **2024-10-15**</sup> | 擅长拳击训练指导与个性化计划制定<br/>`拳击训练` `个性化计划` `健身指导` `进度评估` `技术提升` `健康与营养` |
|
279
|
+
| [椰子](https://chat-preview.lobehub.com/market?agent=deep-thinker-ai)<br/><sup>By **[hia1234](https://github.com/hia1234)** on **2024-10-15**</sup> | 在自己的回答中进行多次审查,确保聊天机器人所说的话有依据,并积极请求反馈,反复进行互动<br/>`编程` `一般` |
|
280
|
+
| [GitHub 项目文档助手](https://chat-preview.lobehub.com/market?agent=github-doc-asst)<br/><sup>By **[Luyi-2333](https://github.com/Luyi-2333)** on **2024-10-14**</sup> | 专注开源项目文档编写与优化<br/>`文档优化` `开源项目` `撰写技巧` `git-hub` |
|
281
|
+
| [眼科医生](https://chat-preview.lobehub.com/market?agent=ophthalmologist)<br/><sup>By **[yuphone](https://github.com/yuphone)** on **2024-10-14**</sup> | 擅长眼科诊断与治疗建议提供<br/>`医疗` `眼科` `诊断` `建议` `专业` |
|
282
|
+
|
283
|
+
> 📊 Total agents: [<kbd>**418**</kbd> ](https://github.com/lobehub/lobe-chat-agents)
|
284
284
|
|
285
285
|
<!-- AGENT LIST -->
|
286
286
|
|
@@ -23,8 +23,8 @@ NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
23
23
|
|
24
24
|
# NextAuth providers configuration (example using Logto)
|
25
25
|
# For other providers, see: https://lobehub.com/docs/self-hosting/environment-variables/auth
|
26
|
-
|
27
|
-
|
26
|
+
AUTH_LOGTO_ID=YOUR_LOGTO_ID
|
27
|
+
AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET
|
28
28
|
AUTH_LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
29
29
|
|
30
30
|
# Proxy settings (if needed, e.g., when using GitHub as an auth provider)
|
@@ -22,8 +22,8 @@ NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
22
22
|
|
23
23
|
# NextAuth 鉴权服务提供商部分,以 Logto 为例
|
24
24
|
# 其他鉴权服务提供商所需的环境变量,请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth
|
25
|
-
|
26
|
-
|
25
|
+
AUTH_LOGTO_ID=YOUR_LOGTO_ID
|
26
|
+
AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET
|
27
27
|
AUTH_LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
28
28
|
|
29
29
|
# 代理相关,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
|
@@ -1,6 +1,9 @@
|
|
1
1
|
---
|
2
2
|
title: Configuring Casdoor Authentication Service in LobeChat
|
3
|
-
description:
|
3
|
+
description: >-
|
4
|
+
Learn how to configure the Casdoor authentication service in LobeChat,
|
5
|
+
including deployment, creation, permission settings, and environment
|
6
|
+
variables.
|
4
7
|
tags:
|
5
8
|
- Casdoor Authentication
|
6
9
|
- Environment Variable Configuration
|
@@ -84,7 +87,6 @@ There are also some optional fields that can enhance user experience:
|
|
84
87
|
box-shadow: none;
|
85
88
|
}
|
86
89
|
}
|
87
|
-
|
88
90
|
</style>
|
89
91
|
```
|
90
92
|
|
@@ -85,8 +85,7 @@ tags:
|
|
85
85
|
box-shadow: none;
|
86
86
|
}
|
87
87
|
}
|
88
|
-
|
89
|
-
</style>
|
88
|
+
</style>
|
90
89
|
```
|
91
90
|
|
92
91
|
随后,复制 `客户端 ID` 和 `客户端密钥`,并保存。
|
@@ -118,4 +117,4 @@ tags:
|
|
118
117
|
</Callout>
|
119
118
|
</Steps>
|
120
119
|
|
121
|
-
<Callout type={'info'}>部署成功后,用户将可以通过 Casdoor 身份认证并使用 LobeChat。</Callout>
|
120
|
+
<Callout type={'info'}>部署成功后,用户将可以通过 Casdoor 身份认证并使用 LobeChat。</Callout>
|
@@ -34,8 +34,7 @@ tags:
|
|
34
34
|
|
35
35
|
至此您已成功在 Clouflare Zero Trust 中创建了一个名为 `LobeChat SSO` 的 SaaS 应用。
|
36
36
|
|
37
|
-
接下来我们需要在 `Redirect URLs` 中填入 `https://chat.example.com/api/auth/callback/cloudflare-zero-trust`(注意此处的 `chat.example.com` 需要替换为您的实例地址)
|
38
|
-

|
37
|
+
接下来我们需要在 `Redirect URLs` 中填入 `https://chat.example.com/api/auth/callback/cloudflare-zero-trust`(注意此处的 `chat.example.com` 需要替换为您的实例地址) 
|
39
38
|
|
40
39
|
最后我们将页面往下滚动,您将需要记录以下三个值 `Client secret`, `Client ID` 及 `Issuer` 以备后续部署 LobeChat 环境变量使用。
|
41
40
|
|
@@ -49,8 +48,8 @@ tags:
|
|
49
48
|
| --- | --- | --- |
|
50
49
|
| `NEXT_AUTH_SECRET` | 必选 | 用于加密 Auth.js 会话令牌的密钥。您可以使用以下命令生成秘钥: `openssl rand -base64 32` |
|
51
50
|
| `NEXT_AUTH_SSO_PROVIDERS` | 必选 | 选择 LoboChat 的单点登录提供商。使用 Cloudflare Zero Trust 请填写 `cloudflare-zero-trust`。 |
|
52
|
-
| `
|
53
|
-
| `
|
51
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_ID` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client ID`,示例值是 `lobe-chat` |
|
52
|
+
| `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET` | 必选 | 在 Cloudflare Zero Trust 生成的 `Client secret`,示例值是 `insecure_secret` |
|
54
53
|
| `AUTH_CLOUDFLARE_ZERO_TRUST_ISSUER` | 必选 | 在 Cloudflare Zero Trust 生成的 `Issuer`,例如 `https://example.cloudflareaccess.com/cdn-cgi/access/sso/oidc/7db0f` |
|
55
54
|
| `NEXTAUTH_URL` | 必选 | 该 URL 用于指定 Auth.js 在执行 OAuth 验证时的回调地址,当默认生成的重定向地址发生不正确时才需要设置。`https://chat.example.com/api/auth` |
|
56
55
|
|
@@ -47,7 +47,7 @@ If you are using Logto Cloud, assume its endpoint domain is `https://example.log
|
|
47
47
|
|
48
48
|
<Image alt="Configure Environment Variables" inStep src="https://github.com/user-attachments/assets/15af6d94-af4f-4aa9-bbab-7a46e9f9e837" />
|
49
49
|
|
50
|
-
Set the obtained `Client ID` and `Client Secret` as `
|
50
|
+
Set the obtained `Client ID` and `Client Secret` as `AUTH_LOGTO_ID` and `AUTH_LOGTO_SECRET` in the LobeChat environment variables.
|
51
51
|
|
52
52
|
Configure `AUTH_LOGTO_ISSUER` in the LobeChat environment variables as follows:
|
53
53
|
|
@@ -51,7 +51,7 @@ tags:
|
|
51
51
|
src="https://github.com/user-attachments/assets/15af6d94-af4f-4aa9-bbab-7a46e9f9e837"
|
52
52
|
/>
|
53
53
|
|
54
|
-
将获取到的 `Client ID` 和 `Client Secret`,设为 LobeChat 环境变量中的 `
|
54
|
+
将获取到的 `Client ID` 和 `Client Secret`,设为 LobeChat 环境变量中的 `AUTH_LOGTO_ID` 和 `AUTH_LOGTO_SECRET`。
|
55
55
|
|
56
56
|
配置 LobeChat 环境变量中 `AUTH_LOGTO_ISSUER` 为:
|
57
57
|
|
@@ -42,14 +42,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
42
42
|
|
43
43
|
### Auth0
|
44
44
|
|
45
|
-
#### `
|
45
|
+
#### `AUTH_AUTH0_ID`
|
46
46
|
|
47
47
|
- Type: Required
|
48
48
|
- Description: Client ID of the Auth0 application. You can access it [here](https://manage.auth0.com/dashboard) and navigate to the application settings to view.
|
49
49
|
- Default: `-`
|
50
50
|
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
51
51
|
|
52
|
-
#### `
|
52
|
+
#### `AUTH_AUTH0_SECRET`
|
53
53
|
|
54
54
|
- Type: Required
|
55
55
|
- Description: Client Secret of the Auth0 application.
|
@@ -65,14 +65,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
65
65
|
|
66
66
|
### Authelia
|
67
67
|
|
68
|
-
#### `
|
68
|
+
#### `AUTH_AUTHELIA_ID`
|
69
69
|
|
70
70
|
- Type: Required
|
71
71
|
- Description: Client ID of the Authelia provider application.
|
72
72
|
- Default: `-`
|
73
73
|
- Example: `lobe-chat`
|
74
74
|
|
75
|
-
#### `
|
75
|
+
#### `AUTH_AUTHELIA_SECRET`
|
76
76
|
|
77
77
|
- Type: Required
|
78
78
|
- Description: The plaintext of the Client Secret for the Authelia provider
|
@@ -88,14 +88,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
88
88
|
|
89
89
|
### Authentik
|
90
90
|
|
91
|
-
#### `
|
91
|
+
#### `AUTH_AUTHENTIK_ID`
|
92
92
|
|
93
93
|
- Type: Required
|
94
94
|
- Description: Client ID of the Authentik provider application.
|
95
95
|
- Default: `-`
|
96
96
|
- Example: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
97
97
|
|
98
|
-
#### `
|
98
|
+
#### `AUTH_AUTHENTIK_SECRET`
|
99
99
|
|
100
100
|
- Type: Required
|
101
101
|
- Description: Client Secret of the Authentik provider application.
|
@@ -111,14 +111,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
111
111
|
|
112
112
|
### Casdoor
|
113
113
|
|
114
|
-
#### `
|
114
|
+
#### `AUTH_CASDOOR_ID`
|
115
115
|
|
116
116
|
- Type: Required
|
117
117
|
- Description: Client ID provided by Casdoor
|
118
118
|
- Default: `-`
|
119
119
|
- Example: `570bfa85a21800a25198`
|
120
120
|
|
121
|
-
#### `
|
121
|
+
#### `AUTH_CASDOOR_SECRET`
|
122
122
|
|
123
123
|
- Type: Required
|
124
124
|
- Description: Plaintext Client Secret provided by Casdoor
|
@@ -134,14 +134,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
134
134
|
|
135
135
|
### Cloudflare Zero Trust
|
136
136
|
|
137
|
-
#### `
|
137
|
+
#### `AUTH_CLOUDFLARE_ZERO_TRUST_ID`
|
138
138
|
|
139
139
|
- Type: Required
|
140
140
|
- Description: Client ID of the Cloudflare Zero Trust provider application.
|
141
141
|
- Default: `-`
|
142
142
|
- Example: `711963a58df8c943cfd6c487cac99ce9f6ee0c88c0b7bf94584b8ff052fcb09c`
|
143
143
|
|
144
|
-
#### `
|
144
|
+
#### `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET`
|
145
145
|
|
146
146
|
- Type: Required
|
147
147
|
- Description: The plaintext of the Client Secret for the Cloudflare Zero Trust provider
|
@@ -157,14 +157,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
157
157
|
|
158
158
|
### Github
|
159
159
|
|
160
|
-
#### `
|
160
|
+
#### `AUTH_GITHUB_ID`
|
161
161
|
|
162
162
|
- Type: Required
|
163
163
|
- Description: Client ID of the Github application. You can access it [here](https://github.com/settings/apps) and navigate to the application settings to view.
|
164
164
|
- Default: `-`
|
165
165
|
- Example: `abd94200333283550508`
|
166
166
|
|
167
|
-
#### `
|
167
|
+
#### `AUTH_GITHUB_SECRET`
|
168
168
|
|
169
169
|
- Type: Required
|
170
170
|
- Description: Client Secret of the Github application.
|
@@ -173,14 +173,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
173
173
|
|
174
174
|
### Logto
|
175
175
|
|
176
|
-
#### `
|
176
|
+
#### `AUTH_LOGTO_ID`
|
177
177
|
|
178
178
|
- Type: Required
|
179
179
|
- Description: The Client ID of the Logto application. You can find it in the Logto console for private deployment or [Logto Cloud](http://cloud.logto.io/) depending on the deployment mode.
|
180
180
|
- Default value: `-`
|
181
181
|
- Example: `123456789012345678@your-project`
|
182
182
|
|
183
|
-
#### `
|
183
|
+
#### `AUTH_LOGTO_SECRET`
|
184
184
|
|
185
185
|
- Type: Required
|
186
186
|
- Description: The Client Secret of the Logto application.
|
@@ -196,14 +196,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
196
196
|
|
197
197
|
### Microsoft Entra ID
|
198
198
|
|
199
|
-
#### `
|
199
|
+
#### `AUTH_AZURE_AD_ID`
|
200
200
|
|
201
201
|
- Type: Required
|
202
202
|
- Description: Client ID of the Microsoft Entra ID application.
|
203
203
|
- Default: `-`
|
204
204
|
- Example: `be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
205
205
|
|
206
|
-
#### `
|
206
|
+
#### `AUTH_AZURE_AD_SECRET`
|
207
207
|
|
208
208
|
- Type: Required
|
209
209
|
- Description: Client Secret of the Microsoft Entra ID application.
|
@@ -219,14 +219,14 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
219
219
|
|
220
220
|
### ZITADEL
|
221
221
|
|
222
|
-
#### `
|
222
|
+
#### `AUTH_ZITADEL_ID`
|
223
223
|
|
224
224
|
- Type: Required
|
225
225
|
- Description: Client ID of the ZITADEL application. This can be found under your application in the ZITADEL console.
|
226
226
|
- Default: `-`
|
227
227
|
- Example: `123456789012345678@your-project`
|
228
228
|
|
229
|
-
#### `
|
229
|
+
#### `AUTH_ZITADEL_SECRET`
|
230
230
|
|
231
231
|
- Type: Required
|
232
232
|
- Description: Client Secret of the ZITADEL application.
|
@@ -242,21 +242,21 @@ LobeChat provides a complete authentication service capability when deployed. Th
|
|
242
242
|
|
243
243
|
### Generic OIDC
|
244
244
|
|
245
|
-
#### `
|
245
|
+
#### `AUTH_GENERIC_OIDC_ID`
|
246
246
|
|
247
247
|
- Type: Required
|
248
248
|
- Description: Client ID of the Generic OIDC provider application.
|
249
249
|
- Default: `-`
|
250
250
|
- Example: `_client_id_for_lobe_chat_`
|
251
251
|
|
252
|
-
#### `
|
252
|
+
#### `AUTH_GENERIC_OIDC_SECRET`
|
253
253
|
|
254
254
|
- Type: Required
|
255
255
|
- Description: The plaintext of the Client Secret for the Generic OIDC provider
|
256
256
|
- Default: `-`
|
257
257
|
- Example: `_client_secret_for_lobe_chat_`
|
258
258
|
|
259
|
-
#### `
|
259
|
+
#### `AUTH_GENERIC_OIDC_ISSUER`
|
260
260
|
|
261
261
|
- Type: Required
|
262
262
|
- Description: Issuer of the Generic OIDC provider application.
|
@@ -40,14 +40,14 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
40
40
|
|
41
41
|
### Auth0
|
42
42
|
|
43
|
-
#### `
|
43
|
+
#### `AUTH_AUTH0_ID`
|
44
44
|
|
45
45
|
- 类型:必选
|
46
46
|
- 描述: Auth0 应用程序的 Client ID,您可以访问[这里](https://manage.auth0.com/dashboard)并导航至应用程序设置来查看
|
47
47
|
- 默认值: `-`
|
48
48
|
- 示例: `evCnOJP1UX8FMnXR9Xkj5t0NyFn5p70P`
|
49
49
|
|
50
|
-
####
|
50
|
+
#### \`AUTH_AUTH_SECRET
|
51
51
|
|
52
52
|
- 类型:必选
|
53
53
|
- 描述: Auth0 应用程序的 Client Secret
|
@@ -63,14 +63,14 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
63
63
|
|
64
64
|
### Authelia
|
65
65
|
|
66
|
-
#### `
|
66
|
+
#### `AUTH_AUTHELIA_ID`
|
67
67
|
|
68
68
|
- 类型:必选
|
69
69
|
- 描述: Authelia 提供程序的 Client ID
|
70
70
|
- 默认值: `-`
|
71
71
|
- 示例: `lobe-chat`
|
72
72
|
|
73
|
-
#### `
|
73
|
+
#### `AUTH_AUTHELIA_SECRET`
|
74
74
|
|
75
75
|
- 类型:必选
|
76
76
|
- 描述: Authelia 提供程序的 Client Secret 的明文
|
@@ -86,14 +86,14 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
86
86
|
|
87
87
|
### Authentik
|
88
88
|
|
89
|
-
#### `
|
89
|
+
#### `AUTH_AUTHENTIK_ID`
|
90
90
|
|
91
91
|
- 类型:必选
|
92
92
|
- 描述: Authentik 提供程序的 Client ID
|
93
93
|
- 默认值: `-`
|
94
94
|
- 示例: `YNtbIRlYF8Kj66mTLue59nsGLlb7HNyx1qjPH6VS`
|
95
95
|
|
96
|
-
#### `
|
96
|
+
#### `AUTH_AUTHENTIK_SECRET`
|
97
97
|
|
98
98
|
- 类型:必选
|
99
99
|
- 描述: Authentik 提供程序的 Client Secret
|
@@ -109,14 +109,14 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
109
109
|
|
110
110
|
### Casdoor
|
111
111
|
|
112
|
-
#### `
|
112
|
+
#### `AUTH_CASDOOR_ID`
|
113
113
|
|
114
114
|
- 类型:必选
|
115
115
|
- 描述: Casdoor 提供程序的 Client ID
|
116
116
|
- 默认值: `-`
|
117
117
|
- 示例: `570bfa85a21800a25198`
|
118
118
|
|
119
|
-
#### `
|
119
|
+
#### `AUTH_CASDOOR_SECRET`
|
120
120
|
|
121
121
|
- 类型:必选
|
122
122
|
- 描述: Casdoor 提供程序的 Client Secret 的明文
|
@@ -132,14 +132,14 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
132
132
|
|
133
133
|
### Cloudflare Zero Trust
|
134
134
|
|
135
|
-
#### `
|
135
|
+
#### `AUTH_CLOUDFLARE_ZERO_TRUST_ID`
|
136
136
|
|
137
137
|
- 类型:必选
|
138
138
|
- 描述: Cloudflare Zero Trust 提供程序的 Client ID
|
139
139
|
- 默认值: `-`
|
140
140
|
- 示例: `711963a58df8c943cfd6c487cac99ce9f6ee0c88c0b7bf94584b8ff052fcb09c`
|
141
141
|
|
142
|
-
#### `
|
142
|
+
#### `AUTH_CLOUDFLARE_ZERO_TRUST_SECRET`
|
143
143
|
|
144
144
|
- 类型:必选
|
145
145
|
- 描述: Cloudflare Zero Trust 提供程序的 Client Secret 的明文
|
@@ -155,30 +155,30 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
155
155
|
|
156
156
|
### Github
|
157
157
|
|
158
|
-
#### `
|
158
|
+
#### `AUTH_GITHUB_ID`
|
159
159
|
|
160
160
|
- 类型:必选
|
161
161
|
- 描述: Github 应用的客户端 ID。您可以在[这里](https://github.com/settings/apps)访问,并导航到应用程序设置以查看。
|
162
162
|
- 默认值: `-`
|
163
163
|
- 示例: `abd94200333283550508`
|
164
164
|
|
165
|
-
#### `
|
165
|
+
#### `AUTH_GITHUB_SECRET`
|
166
166
|
|
167
167
|
- 类型:必选
|
168
|
-
- 描述: Github应用的客户端密钥。
|
168
|
+
- 描述: Github 应用的客户端密钥。
|
169
169
|
- 默认值: `-`
|
170
170
|
- 示例: `dd262976ac0931d947e104891586a053f3d3750b`
|
171
171
|
|
172
172
|
### Logto
|
173
173
|
|
174
|
-
#### `
|
174
|
+
#### `AUTH_LOGTO_ID`
|
175
175
|
|
176
176
|
- 类型:必选
|
177
177
|
- 描述:Logto 应用程序的 Client ID。您可以在根据部署模式,在私有部署的 Logto 控制台或 [Logto Cloud](http://cloud.logto.io/) 中找到。
|
178
178
|
- 默认值:`-`
|
179
179
|
- 示例:`123456789012345678@your-project`
|
180
180
|
|
181
|
-
#### `
|
181
|
+
#### `AUTH_LOGTO_SECRET`
|
182
182
|
|
183
183
|
- 类型:必选
|
184
184
|
- 描述:Logto 应用程序的 Client Secret。
|
@@ -194,14 +194,14 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
194
194
|
|
195
195
|
### Microsoft Entra ID
|
196
196
|
|
197
|
-
#### `
|
197
|
+
#### `AUTH_AZURE_AD_ID`
|
198
198
|
|
199
199
|
- 类型:必选
|
200
200
|
- 描述:Microsoft Entra ID 应用程序的客户端 ID。
|
201
201
|
- 默认值:`-`
|
202
202
|
- 示例:`be8f6da1-58c3-4f16-ff1b-78f5148e10df`
|
203
203
|
|
204
|
-
#### `
|
204
|
+
#### `AUTH_AZURE_AD_SECRET`
|
205
205
|
|
206
206
|
- 类型:必选
|
207
207
|
- 描述:Microsoft Entra ID 应用程序的客户端密钥。
|
@@ -217,14 +217,14 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
217
217
|
|
218
218
|
### ZITADEL
|
219
219
|
|
220
|
-
#### `
|
220
|
+
#### `AUTH_ZITADEL_ID`
|
221
221
|
|
222
222
|
- 类型:必选
|
223
223
|
- 描述:ZITADEL 应用的 Client ID。您可以在 ZITADEL 控制台应用设置中找到 Client ID。
|
224
224
|
- 默认值:`-`
|
225
225
|
- 示例:`123456789012345678@your-project`
|
226
226
|
|
227
|
-
#### `
|
227
|
+
#### `AUTH_ZITADEL_SECRET`
|
228
228
|
|
229
229
|
- 类型:必选
|
230
230
|
- 描述:ZITADEL 应用的 Client Secret。
|
@@ -240,21 +240,21 @@ LobeChat 在部署时提供了完善的身份验证服务能力,以下是相
|
|
240
240
|
|
241
241
|
### Generic OIDC
|
242
242
|
|
243
|
-
#### `
|
243
|
+
#### `AUTH_GENERIC_OIDC_ID`
|
244
244
|
|
245
245
|
- 类型:必选
|
246
246
|
- 描述: Generic OIDC 提供程序的 Client ID
|
247
247
|
- 默认值: `-`
|
248
248
|
- 示例: `_client_id_for_lobe_chat_`
|
249
249
|
|
250
|
-
#### `
|
250
|
+
#### `AUTH_GENERIC_OIDC_SECRET`
|
251
251
|
|
252
252
|
- 类型:必选
|
253
253
|
- 描述: Generic OIDC 提供程序的 Client Secret 的明文
|
254
254
|
- 默认值: `-`
|
255
255
|
- 示例: `_client_secret_for_lobe_chat_`
|
256
256
|
|
257
|
-
#### `
|
257
|
+
#### `AUTH_GENERIC_OIDC_ISSUER`
|
258
258
|
|
259
259
|
- 类型:必选
|
260
260
|
- 描述: Generic OIDC 提供程序的 OpenID Connect 颁发者
|
@@ -1,6 +1,8 @@
|
|
1
1
|
---
|
2
2
|
title: Deploying LobeChat with Docker Compose
|
3
|
-
description:
|
3
|
+
description: >-
|
4
|
+
Learn how to deploy the LobeChat service using Docker Compose, including
|
5
|
+
configuration tutorials for various services.
|
4
6
|
tags:
|
5
7
|
- Docker Compose
|
6
8
|
- LobeChat
|
@@ -402,8 +404,8 @@ NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
402
404
|
|
403
405
|
# NextAuth providers configuration (example using Logto)
|
404
406
|
# For other providers, see: https://lobehub.com/docs/self-hosting/environment-variables/auth
|
405
|
-
|
406
|
-
|
407
|
+
AUTH_LOGTO_ID=YOUR_LOGTO_ID
|
408
|
+
AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET
|
407
409
|
AUTH_LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
408
410
|
|
409
411
|
# Proxy settings (if needed, e.g., when using GitHub as an auth provider)
|
@@ -474,7 +476,6 @@ services:
|
|
474
476
|
command: >
|
475
477
|
server /etc/minio/data --address ":9000" --console-address ":9001"
|
476
478
|
|
477
|
-
|
478
479
|
logto:
|
479
480
|
image: svhd/logto
|
480
481
|
container_name: lobe-logto
|
@@ -397,8 +397,8 @@ NEXTAUTH_URL=https://lobe.example.com/api/auth
|
|
397
397
|
|
398
398
|
# NextAuth 鉴权服务提供商部分,以 Logto 为例
|
399
399
|
# 其他鉴权服务提供商所需的环境变量,请参考:https://lobehub.com/zh/docs/self-hosting/environment-variables/auth
|
400
|
-
AUTH_LOGTO_ID=
|
401
|
-
AUTH_LOGTO_SECRET=
|
400
|
+
AUTH_LOGTO_ID=YOUR_LOGTO_ID
|
401
|
+
AUTH_LOGTO_SECRET=YOUR_LOGTO_SECRET
|
402
402
|
AUTH_LOGTO_ISSUER=https://lobe-auth-api.example.com/oidc
|
403
403
|
|
404
404
|
# 代理相关,如果你需要的话(比如你使用 GitHub 作为鉴权服务提供商)
|
@@ -469,7 +469,6 @@ services:
|
|
469
469
|
command: >
|
470
470
|
server /etc/minio/data --address ":9000" --console-address ":9001"
|
471
471
|
|
472
|
-
|
473
472
|
logto:
|
474
473
|
image: svhd/logto
|
475
474
|
container_name: lobe-logto
|
@@ -73,9 +73,9 @@ DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres
|
|
73
73
|
NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250
|
74
74
|
NEXT_AUTH_SSO_PROVIDERS=auth0
|
75
75
|
NEXTAUTH_URL=https://your-prod-domain.com/api/auth
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
AUTH_AUTH0_ID=xxxxxx
|
77
|
+
AUTH_AUTH0_SECRET=cSX_xxxxx
|
78
|
+
AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com
|
79
79
|
|
80
80
|
# S3 related
|
81
81
|
S3_ACCESS_KEY_ID=xxxxxxxxxx
|
@@ -136,9 +136,9 @@ $ docker run -it -d --name lobe-chat-database -p 3210:3210 \
|
|
136
136
|
-e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \
|
137
137
|
-e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \
|
138
138
|
-e NEXT_AUTH_SSO_PROVIDERS=auth0 \
|
139
|
-
-e
|
140
|
-
-e
|
141
|
-
-e
|
139
|
+
-e AUTH_AUTH0_ID=xxxxxx \
|
140
|
+
-e AUTH_AUTH0_SECRET=cSX_xxxxx \
|
141
|
+
-e AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \
|
142
142
|
-e APP_URL=http://localhost:3210 \
|
143
143
|
-e NEXTAUTH_URL=http://localhost:3210/api/auth \
|
144
144
|
-e S3_ACCESS_KEY_ID=xxxxxxxxxx \
|
@@ -77,9 +77,9 @@ DATABASE_URL=postgres://postgres:mysecretpassword@my-postgres:5432/postgres
|
|
77
77
|
NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250
|
78
78
|
NEXT_AUTH_SSO_PROVIDERS=auth0
|
79
79
|
NEXTAUTH_URL=https://your-prod-domain.com/api/auth
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
AUTH_AUTH0_ID=xxxxxx
|
81
|
+
AUTH_AUTH0_SECRET=cSX_xxxxx
|
82
|
+
AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com
|
83
83
|
|
84
84
|
# S3 相关
|
85
85
|
S3_ACCESS_KEY_ID=xxxxxxxxxx
|
@@ -147,9 +147,9 @@ $ docker run -it -d --name lobe-chat-database -p 3210:3210 \
|
|
147
147
|
-e KEY_VAULTS_SECRET=jgwsK28dspyVQoIf8/M3IIHl1h6LYYceSYNXeLpy6uk= \
|
148
148
|
-e NEXT_AUTH_SECRET=3904039cd41ea1bdf6c93db0db96e250 \
|
149
149
|
-e NEXT_AUTH_SSO_PROVIDERS=auth0 \
|
150
|
-
-e
|
151
|
-
-e
|
152
|
-
-e
|
150
|
+
-e AUTH_AUTH0_ID=xxxxxx \
|
151
|
+
-e AUTH_AUTH0_SECRET=cSX_xxxxx \
|
152
|
+
-e AUTH_AUTH0_ISSUER=https://lobe-chat-demo.us.auth0.com \
|
153
153
|
-e APP_URL=http://localhost:3210 \
|
154
154
|
-e NEXTAUTH_URL=http://localhost:3210/api/auth \
|
155
155
|
-e S3_ACCESS_KEY_ID=xxxxxxxxxx \
|
@@ -67,10 +67,7 @@ You can check [this document](../advanced/auth.mdx) for a more detailed guide.
|
|
67
67
|
|
68
68
|
Fill in those variables into your LobeChat service on Zeabur, here is a more detailed guide for [editing environment variables on Zeabur](https://zeabur.com/docs/deploy/variables).
|
69
69
|
|
70
|
-
|
71
|
-
LOGTO_CLIENT_ID=your_logto_client_id
|
72
|
-
LOGTO_CLIENT_SECRET=your_logto_client_secret
|
73
|
-
```
|
70
|
+
For detailed configuration of Logto, refer to [this document](/docs/self-hosting/advanced/auth/next-auth/logto).
|
74
71
|
|
75
72
|
### Access your LobeChat Instance
|
76
73
|
|
@@ -59,7 +59,7 @@ tags:
|
|
59
59
|
使用你刚绑定的域名来访问你的 Logto 控制台,创建一个新项目以获得对应的客户端 ID 与密钥,将它们填入你的 LobeChat 服务的变量中。
|
60
60
|
关于如何填入变量,可以参照 [Zeabur 的官方文档](https://zeabur.com/docs/deploy/variables)。
|
61
61
|
|
62
|
-
Logto 的详细配置可以参考[这篇文档](
|
62
|
+
Logto 的详细配置可以参考[这篇文档](/zh/docs/self-hosting/advanced/auth/next-auth/logto)。
|
63
63
|
|
64
64
|
### 访问你的 LobeChat
|
65
65
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.22.
|
3
|
+
"version": "1.22.7",
|
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",
|
@@ -9,26 +9,6 @@ const HuggingFace: ModelProviderCard = {
|
|
9
9
|
id: 'mistralai/Mistral-7B-Instruct-v0.2',
|
10
10
|
tokens: 8192,
|
11
11
|
},
|
12
|
-
{
|
13
|
-
description: '高质量多语言聊天模型,具有较大上下文长度',
|
14
|
-
displayName: 'Llama 3.1 8B Instruct',
|
15
|
-
enabled: true,
|
16
|
-
id: 'meta-llama/Meta-Llama-3.1-8B-Instruct',
|
17
|
-
tokens: 8192,
|
18
|
-
},
|
19
|
-
{
|
20
|
-
description: '高质量多语言聊天模型,具有大型上下文长度',
|
21
|
-
displayName: 'Llama 3.1 70B Instruct',
|
22
|
-
enabled: true,
|
23
|
-
id: 'meta-llama/Meta-Llama-3.1-70B-Instruct',
|
24
|
-
tokens: 32_768,
|
25
|
-
},
|
26
|
-
{
|
27
|
-
description: '最佳对话模型之一',
|
28
|
-
displayName: 'Llama 2 7B Chat',
|
29
|
-
id: 'meta-llama/Llama-2-7b-chat-hf',
|
30
|
-
tokens: 4096,
|
31
|
-
},
|
32
12
|
{
|
33
13
|
description: 'Google的轻量级指令调优模型',
|
34
14
|
displayName: 'Gemma 2 2B Instruct',
|
@@ -58,13 +58,39 @@ const SiliconCloud: ModelProviderCard = {
|
|
58
58
|
displayName: 'Qwen2.5 72B',
|
59
59
|
enabled: true,
|
60
60
|
functionCall: true,
|
61
|
-
id: 'Qwen/Qwen2.5-72B-Instruct',
|
61
|
+
id: 'Qwen/Qwen2.5-72B-Instruct-128K',
|
62
62
|
pricing: {
|
63
63
|
currency: 'CNY',
|
64
64
|
input: 4.13,
|
65
65
|
output: 4.13,
|
66
66
|
},
|
67
|
+
tokens: 131_072,
|
68
|
+
},
|
69
|
+
{
|
70
|
+
description: 'Qwen2-VL 是 Qwen-VL 模型的最新迭代版本,在视觉理解基准测试中达到了最先进的性能。',
|
71
|
+
displayName: 'Qwen2 VL 7B',
|
72
|
+
enabled: true,
|
73
|
+
id: 'Pro/Qwen/Qwen2-VL-7B-Instruct',
|
74
|
+
pricing: {
|
75
|
+
currency: 'CNY',
|
76
|
+
input: 0.35,
|
77
|
+
output: 0.35,
|
78
|
+
},
|
67
79
|
tokens: 32_768,
|
80
|
+
vision: true,
|
81
|
+
},
|
82
|
+
{
|
83
|
+
description: 'Qwen2-VL 是 Qwen-VL 模型的最新迭代版本,在视觉理解基准测试中达到了最先进的性能。',
|
84
|
+
displayName: 'Qwen2 VL 72B',
|
85
|
+
enabled: true,
|
86
|
+
id: 'Qwen/Qwen2-VL-72B-Instruct',
|
87
|
+
pricing: {
|
88
|
+
currency: 'CNY',
|
89
|
+
input: 4.13,
|
90
|
+
output: 4.13,
|
91
|
+
},
|
92
|
+
tokens: 32_768,
|
93
|
+
vision: true,
|
68
94
|
},
|
69
95
|
{
|
70
96
|
description: 'Qwen2.5-Math 专注于数学领域的问题求解,为高难度题提供专业解答。',
|
@@ -114,6 +140,42 @@ const SiliconCloud: ModelProviderCard = {
|
|
114
140
|
},
|
115
141
|
tokens: 32_768,
|
116
142
|
},
|
143
|
+
{
|
144
|
+
description: 'InternVL2在各种视觉语言任务上展现出了卓越的性能,包括文档和图表理解、场景文本理解、OCR、科学和数学问题解决等。',
|
145
|
+
displayName: 'InternVL2 8B',
|
146
|
+
id: 'Pro/OpenGVLab/InternVL2-8B',
|
147
|
+
pricing: {
|
148
|
+
currency: 'CNY',
|
149
|
+
input: 0.35,
|
150
|
+
output: 0.35,
|
151
|
+
},
|
152
|
+
tokens: 32_768,
|
153
|
+
vision: true,
|
154
|
+
},
|
155
|
+
{
|
156
|
+
description: 'InternVL2在各种视觉语言任务上展现出了卓越的性能,包括文档和图表理解、场景文本理解、OCR、科学和数学问题解决等。',
|
157
|
+
displayName: 'InternVL2 26B',
|
158
|
+
id: 'OpenGVLab/InternVL2-26B',
|
159
|
+
pricing: {
|
160
|
+
currency: 'CNY',
|
161
|
+
input: 1,
|
162
|
+
output: 1,
|
163
|
+
},
|
164
|
+
tokens: 32_768,
|
165
|
+
vision: true,
|
166
|
+
},
|
167
|
+
{
|
168
|
+
description: 'InternVL2在各种视觉语言任务上展现出了卓越的性能,包括文档和图表理解、场景文本理解、OCR、科学和数学问题解决等。',
|
169
|
+
displayName: 'InternVL2 Llama3 76B',
|
170
|
+
id: 'OpenGVLab/InternVL2-Llama3-76B',
|
171
|
+
pricing: {
|
172
|
+
currency: 'CNY',
|
173
|
+
input: 4.13,
|
174
|
+
output: 4.13,
|
175
|
+
},
|
176
|
+
tokens: 8192,
|
177
|
+
vision: true,
|
178
|
+
},
|
117
179
|
{
|
118
180
|
description: 'GLM-4 9B 开放源码版本,为会话应用提供优化后的对话体验。',
|
119
181
|
displayName: 'GLM-4 9B',
|
@@ -30,7 +30,7 @@ const SkeletonList = memo<SkeletonListProps>(({ mobile }) => {
|
|
30
30
|
const { cx, styles } = useStyles();
|
31
31
|
|
32
32
|
return (
|
33
|
-
<Flexbox gap={24} padding={mobile ? 8 : 12} style={{ marginTop: 24
|
33
|
+
<Flexbox gap={24} padding={mobile ? 8 : 12} style={{ marginTop: 24 }}>
|
34
34
|
<Skeleton
|
35
35
|
active
|
36
36
|
avatar={{ size: mobile ? 32 : 40 }}
|
@@ -24,7 +24,7 @@ import { setNamespace } from '@/utils/storeDebug';
|
|
24
24
|
import { chatSelectors, topicSelectors } from '../../selectors';
|
25
25
|
import { ChatRAGAction, chatRag } from './actions/rag';
|
26
26
|
|
27
|
-
const n = setNamespace('
|
27
|
+
const n = setNamespace('ai');
|
28
28
|
|
29
29
|
export interface SendMessageParams {
|
30
30
|
message: string;
|
@@ -47,17 +47,21 @@ interface ProcessMessageParams {
|
|
47
47
|
}
|
48
48
|
|
49
49
|
export interface ChatAIChatAction extends ChatRAGAction {
|
50
|
-
|
50
|
+
/**
|
51
|
+
* Sends a new message to the AI chat system
|
52
|
+
*/
|
51
53
|
sendMessage: (params: SendMessageParams) => Promise<void>;
|
52
54
|
/**
|
53
|
-
*
|
54
|
-
* trace enabled
|
55
|
-
* @param id
|
55
|
+
* Regenerates a specific message in the chat
|
56
56
|
*/
|
57
57
|
regenerateMessage: (id: string) => Promise<void>;
|
58
|
-
|
59
|
-
|
58
|
+
/**
|
59
|
+
* Deletes an existing message and generates a new one in its place
|
60
|
+
*/
|
60
61
|
delAndRegenerateMessage: (id: string) => Promise<void>;
|
62
|
+
/**
|
63
|
+
* Interrupts the ongoing ai message generation process
|
64
|
+
*/
|
61
65
|
stopGenerateMessage: () => void;
|
62
66
|
|
63
67
|
// ========= ↓ Internal Method ↓ ========== //
|
@@ -65,7 +69,8 @@ export interface ChatAIChatAction extends ChatRAGAction {
|
|
65
69
|
// ========================================== //
|
66
70
|
|
67
71
|
/**
|
68
|
-
*
|
72
|
+
* Executes the core processing logic for AI messages
|
73
|
+
* including preprocessing and postprocessing steps
|
69
74
|
*/
|
70
75
|
internal_coreProcessMessage: (
|
71
76
|
messages: ChatMessage[],
|
@@ -73,7 +78,7 @@ export interface ChatAIChatAction extends ChatRAGAction {
|
|
73
78
|
params?: ProcessMessageParams,
|
74
79
|
) => Promise<void>;
|
75
80
|
/**
|
76
|
-
*
|
81
|
+
* Retrieves an AI-generated chat message from the backend service
|
77
82
|
*/
|
78
83
|
internal_fetchAIChatMessage: (
|
79
84
|
messages: ChatMessage[],
|
@@ -83,11 +88,12 @@ export interface ChatAIChatAction extends ChatRAGAction {
|
|
83
88
|
isFunctionCall: boolean;
|
84
89
|
traceId?: string;
|
85
90
|
}>;
|
86
|
-
|
91
|
+
/**
|
92
|
+
* Resends a specific message, optionally using a trace ID for tracking
|
93
|
+
*/
|
87
94
|
internal_resendMessage: (id: string, traceId?: string) => Promise<void>;
|
88
|
-
|
89
95
|
/**
|
90
|
-
*
|
96
|
+
* Toggles the loading state for AI message generation, managing the UI feedback
|
91
97
|
*/
|
92
98
|
internal_toggleChatLoading: (
|
93
99
|
loading: boolean,
|
@@ -95,7 +101,7 @@ export interface ChatAIChatAction extends ChatRAGAction {
|
|
95
101
|
action?: string,
|
96
102
|
) => AbortController | undefined;
|
97
103
|
/**
|
98
|
-
*
|
104
|
+
* Controls the streaming state of tool calling processes, updating the UI accordingly
|
99
105
|
*/
|
100
106
|
internal_toggleToolCallingStreaming: (id: string, streaming: boolean[] | undefined) => void;
|
101
107
|
}
|
@@ -139,7 +145,7 @@ export const chatAiChat: StateCreator<
|
|
139
145
|
// if message is empty or no files, then stop
|
140
146
|
if (!message && !hasFile) return;
|
141
147
|
|
142
|
-
set({ isCreatingMessage: true }, false, 'creatingMessage/start');
|
148
|
+
set({ isCreatingMessage: true }, false, n('creatingMessage/start'));
|
143
149
|
|
144
150
|
const newMessage: CreateMessageParams = {
|
145
151
|
content: message,
|
@@ -184,10 +190,7 @@ export const chatAiChat: StateCreator<
|
|
184
190
|
...get().messagesMap,
|
185
191
|
[messageMapKey(activeId, topicId)]: get().messagesMap[mapKey],
|
186
192
|
};
|
187
|
-
set({ messagesMap: newMaps }, false, '
|
188
|
-
|
189
|
-
// get().internal_dispatchMessage({ type: 'deleteMessage', id: tempMessageId });
|
190
|
-
get().internal_toggleMessageLoading(false, tempMessageId);
|
193
|
+
set({ messagesMap: newMaps }, false, n('moveMessagesToNewTopic'));
|
191
194
|
|
192
195
|
// make the topic loading
|
193
196
|
get().internal_updateTopicLoading(topicId, true);
|
@@ -199,9 +202,11 @@ export const chatAiChat: StateCreator<
|
|
199
202
|
|
200
203
|
const id = await get().internal_createMessage(newMessage, {
|
201
204
|
tempMessageId,
|
202
|
-
skipRefresh: !onlyAddUserMessage,
|
205
|
+
skipRefresh: !onlyAddUserMessage && newMessage.fileList?.length === 0,
|
203
206
|
});
|
204
207
|
|
208
|
+
if (tempMessageId) get().internal_toggleMessageLoading(false, tempMessageId);
|
209
|
+
|
205
210
|
// switch to the new topic if create the new topic
|
206
211
|
if (!!newTopicId) {
|
207
212
|
await get().switchTopic(newTopicId, true);
|
@@ -228,7 +233,7 @@ export const chatAiChat: StateCreator<
|
|
228
233
|
ragQuery: get().internal_shouldUseRAG() ? message : undefined,
|
229
234
|
});
|
230
235
|
|
231
|
-
set({ isCreatingMessage: false }, false, 'creatingMessage/stop');
|
236
|
+
set({ isCreatingMessage: false }, false, n('creatingMessage/stop'));
|
232
237
|
|
233
238
|
const summaryTitle = async () => {
|
234
239
|
// if autoCreateTopic is false, then stop
|
@@ -9,7 +9,7 @@ export const preventLeavingFn = (e: BeforeUnloadEvent) => {
|
|
9
9
|
export const toggleBooleanList = (ids: string[], id: string, loading: boolean) => {
|
10
10
|
return produce(ids, (draft) => {
|
11
11
|
if (loading) {
|
12
|
-
draft.push(id);
|
12
|
+
if (!draft.includes(id)) draft.push(id);
|
13
13
|
} else {
|
14
14
|
const index = draft.indexOf(id);
|
15
15
|
|