@lobehub/chat 1.114.6 → 1.116.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/.cursor/rules/add-provider-doc.mdc +183 -0
- package/.cursor/rules/project-introduce.mdc +1 -15
- package/.cursor/rules/project-structure.mdc +227 -0
- package/.cursor/rules/testing-guide/db-model-test.mdc +5 -3
- package/.cursor/rules/testing-guide/testing-guide.mdc +153 -168
- package/.env.example +8 -0
- package/.github/workflows/claude.yml +1 -1
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/test.yml +10 -5
- package/CHANGELOG.md +50 -0
- package/CLAUDE.md +17 -33
- package/Dockerfile +5 -1
- package/Dockerfile.database +5 -1
- package/Dockerfile.pglite +5 -1
- package/changelog/v1.json +14 -0
- package/docs/development/basic/feature-development.mdx +1 -1
- package/docs/development/basic/feature-development.zh-CN.mdx +1 -1
- package/docs/development/basic/setup-development.mdx +10 -13
- package/docs/development/basic/setup-development.zh-CN.mdx +9 -12
- package/docs/self-hosting/environment-variables/model-provider.mdx +27 -2
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +27 -2
- package/docs/usage/providers/bfl.mdx +68 -0
- package/docs/usage/providers/bfl.zh-CN.mdx +67 -0
- package/locales/ar/components.json +11 -0
- package/locales/ar/error.json +11 -0
- package/locales/ar/models.json +64 -4
- package/locales/ar/providers.json +3 -0
- package/locales/bg-BG/components.json +11 -0
- package/locales/bg-BG/error.json +11 -0
- package/locales/bg-BG/models.json +64 -4
- package/locales/bg-BG/providers.json +3 -0
- package/locales/de-DE/components.json +11 -0
- package/locales/de-DE/error.json +11 -12
- package/locales/de-DE/models.json +64 -4
- package/locales/de-DE/providers.json +3 -0
- package/locales/en-US/components.json +6 -0
- package/locales/en-US/error.json +11 -12
- package/locales/en-US/models.json +64 -4
- package/locales/en-US/providers.json +3 -0
- package/locales/es-ES/components.json +11 -0
- package/locales/es-ES/error.json +11 -0
- package/locales/es-ES/models.json +64 -6
- package/locales/es-ES/providers.json +3 -0
- package/locales/fa-IR/components.json +11 -0
- package/locales/fa-IR/error.json +11 -0
- package/locales/fa-IR/models.json +64 -4
- package/locales/fa-IR/providers.json +3 -0
- package/locales/fr-FR/components.json +11 -0
- package/locales/fr-FR/error.json +11 -12
- package/locales/fr-FR/models.json +64 -4
- package/locales/fr-FR/providers.json +3 -0
- package/locales/it-IT/components.json +11 -0
- package/locales/it-IT/error.json +11 -0
- package/locales/it-IT/models.json +64 -4
- package/locales/it-IT/providers.json +3 -0
- package/locales/ja-JP/components.json +11 -0
- package/locales/ja-JP/error.json +11 -12
- package/locales/ja-JP/models.json +64 -4
- package/locales/ja-JP/providers.json +3 -0
- package/locales/ko-KR/components.json +11 -0
- package/locales/ko-KR/error.json +11 -12
- package/locales/ko-KR/models.json +64 -6
- package/locales/ko-KR/providers.json +3 -0
- package/locales/nl-NL/components.json +11 -0
- package/locales/nl-NL/error.json +11 -0
- package/locales/nl-NL/models.json +62 -4
- package/locales/nl-NL/providers.json +3 -0
- package/locales/pl-PL/components.json +11 -0
- package/locales/pl-PL/error.json +11 -0
- package/locales/pl-PL/models.json +64 -4
- package/locales/pl-PL/providers.json +3 -0
- package/locales/pt-BR/components.json +11 -0
- package/locales/pt-BR/error.json +11 -0
- package/locales/pt-BR/models.json +64 -4
- package/locales/pt-BR/providers.json +3 -0
- package/locales/ru-RU/components.json +11 -0
- package/locales/ru-RU/error.json +11 -0
- package/locales/ru-RU/models.json +64 -4
- package/locales/ru-RU/providers.json +3 -0
- package/locales/tr-TR/components.json +11 -0
- package/locales/tr-TR/error.json +11 -0
- package/locales/tr-TR/models.json +64 -4
- package/locales/tr-TR/providers.json +3 -0
- package/locales/vi-VN/components.json +11 -0
- package/locales/vi-VN/error.json +11 -0
- package/locales/vi-VN/models.json +64 -4
- package/locales/vi-VN/providers.json +3 -0
- package/locales/zh-CN/components.json +6 -0
- package/locales/zh-CN/error.json +11 -0
- package/locales/zh-CN/models.json +64 -4
- package/locales/zh-CN/providers.json +3 -0
- package/locales/zh-TW/components.json +11 -0
- package/locales/zh-TW/error.json +11 -12
- package/locales/zh-TW/models.json +64 -6
- package/locales/zh-TW/providers.json +3 -0
- package/package.json +4 -4
- package/packages/const/src/image.ts +28 -0
- package/packages/const/src/index.ts +1 -0
- package/packages/database/package.json +4 -2
- package/packages/database/src/repositories/aiInfra/index.ts +1 -1
- package/packages/database/tests/setup-db.ts +3 -0
- package/packages/database/vitest.config.mts +33 -0
- package/packages/model-runtime/src/google/index.ts +3 -0
- package/packages/model-runtime/src/qwen/createImage.test.ts +0 -19
- package/packages/model-runtime/src/qwen/createImage.ts +1 -27
- package/packages/model-runtime/src/utils/modelParse.ts +1 -1
- package/packages/model-runtime/src/utils/streams/google-ai.ts +26 -14
- package/packages/types/src/aiModel.ts +2 -1
- package/packages/utils/src/client/imageDimensions.test.ts +95 -0
- package/packages/utils/src/client/imageDimensions.ts +54 -0
- package/packages/utils/src/number.test.ts +3 -1
- package/packages/utils/src/number.ts +1 -2
- package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +1 -1
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/DimensionControlGroup.tsx +0 -1
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUpload.tsx +16 -6
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUrl.tsx +14 -2
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUrlsUpload.tsx +27 -2
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/MultiImagesUpload/index.tsx +23 -5
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/hooks/useAutoDimensions.ts +56 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/index.tsx +82 -5
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/utils/__tests__/dimensionConstraints.test.ts +235 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/utils/__tests__/imageValidation.test.ts +401 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/utils/dimensionConstraints.ts +54 -0
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicItem.tsx +3 -1
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicList.tsx +15 -2
- package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts +5 -4
- package/src/config/aiModels/google.ts +22 -1
- package/src/config/aiModels/qwen.ts +2 -2
- package/src/config/aiModels/vertexai.ts +22 -0
- package/src/libs/standard-parameters/index.ts +1 -1
- package/src/server/services/generation/index.ts +1 -1
- package/src/store/chat/slices/builtinTool/actions/dalle.test.ts +20 -13
- package/src/store/file/slices/upload/action.ts +18 -7
- package/src/store/image/slices/generationConfig/hooks.ts +1 -1
- package/tsconfig.json +1 -10
- package/.cursor/rules/debug.mdc +0 -193
- package/packages/const/src/imageGeneration.ts +0 -16
- package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +0 -26
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/AspectRatioSelect.tsx +0 -24
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/SizeSliderInput.tsx +0 -15
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicItemContainer.tsx +0 -91
- package/src/app/desktop/devtools/page.tsx +0 -89
- package/src/app/desktop/layout.tsx +0 -31
- /package/apps/desktop/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/database/{vitest.config.ts → vitest.config.server.mts} +0 -0
- /package/packages/electron-server-ipc/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/file-loaders/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/model-runtime/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/prompts/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/utils/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/web-crawler/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/{vitest.config.ts → vitest.config.mts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
## [Version 1.116.0](https://github.com/lobehub/lobe-chat/compare/v1.115.0...v1.116.0)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-08-27**</sup>
|
|
8
|
+
|
|
9
|
+
#### ✨ Features
|
|
10
|
+
|
|
11
|
+
- **misc**: Add gemini 2.5 flash image for vertex ai.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's improved
|
|
19
|
+
|
|
20
|
+
- **misc**: Add gemini 2.5 flash image for vertex ai, closes [#8943](https://github.com/lobehub/lobe-chat/issues/8943) ([74d9bb5](https://github.com/lobehub/lobe-chat/commit/74d9bb5))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
## [Version 1.115.0](https://github.com/lobehub/lobe-chat/compare/v1.114.6...v1.115.0)
|
|
31
|
+
|
|
32
|
+
<sup>Released on **2025-08-26**</sup>
|
|
33
|
+
|
|
34
|
+
#### ✨ Features
|
|
35
|
+
|
|
36
|
+
- **image**: Polish ai image.
|
|
37
|
+
|
|
38
|
+
<br/>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
42
|
+
|
|
43
|
+
#### What's improved
|
|
44
|
+
|
|
45
|
+
- **image**: Polish ai image, closes [#8915](https://github.com/lobehub/lobe-chat/issues/8915) ([0efe28d](https://github.com/lobehub/lobe-chat/commit/0efe28d))
|
|
46
|
+
|
|
47
|
+
</details>
|
|
48
|
+
|
|
49
|
+
<div align="right">
|
|
50
|
+
|
|
51
|
+
[](#readme-top)
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
5
55
|
### [Version 1.114.6](https://github.com/lobehub/lobe-chat/compare/v1.114.5...v1.114.6)
|
|
6
56
|
|
|
7
57
|
<sup>Released on **2025-08-22**</sup>
|
package/CLAUDE.md
CHANGED
|
@@ -2,45 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
This document serves as a shared guideline for all team members when using Claude Code in this repository.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Tech Stack
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- Please store all temporary scripts (such as migration and refactoring scripts) in the `docs/.local/` directory; the contents of this folder will not be committed.
|
|
7
|
+
read @.cursor/rules/project-introduce.mdc
|
|
9
8
|
|
|
10
|
-
##
|
|
9
|
+
## Directory Structure
|
|
11
10
|
|
|
12
|
-
read @.cursor/rules/project-
|
|
13
|
-
|
|
14
|
-
### Directory Structure
|
|
15
|
-
|
|
16
|
-
```plaintext
|
|
17
|
-
src/
|
|
18
|
-
├── app/ # Next.js App Router
|
|
19
|
-
├── features/ # Feature-based UI components
|
|
20
|
-
├── store/ # Zustand state stores
|
|
21
|
-
├── services/ # Client services (tRPC/Model calls)
|
|
22
|
-
├── server/ # Server-side (tRPC routers, services)
|
|
23
|
-
├── database/ # Schemas, models, repositories
|
|
24
|
-
├── libs/ # External library integrations
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Data Flow
|
|
28
|
-
|
|
29
|
-
- **Client DB Version**: UI → Zustand → Service → Model → PGLite
|
|
30
|
-
- **Server DB Version**: UI → Zustand → Service → tRPC → Repository/Model → PostgreSQL
|
|
11
|
+
read @.cursor/rules/project-structure.mdc
|
|
31
12
|
|
|
32
13
|
## Development
|
|
33
14
|
|
|
34
15
|
### Git Workflow
|
|
35
16
|
|
|
36
|
-
- use rebase for git pull
|
|
37
|
-
- git commit message should prefix with gitmoji
|
|
17
|
+
- use rebase for git pull
|
|
18
|
+
- git commit message should prefix with gitmoji
|
|
38
19
|
- git branch name format example: tj/feat/feature-name
|
|
39
20
|
- use .github/PULL_REQUEST_TEMPLATE.md to generate pull request description
|
|
40
21
|
|
|
41
22
|
### Package Management
|
|
42
23
|
|
|
43
|
-
|
|
24
|
+
This repository adopts a monorepo structure.
|
|
25
|
+
|
|
26
|
+
- Use `pnpm` as the primary package manager for dependency management
|
|
27
|
+
- Use `bun` to run npm scripts at the root level
|
|
28
|
+
- Use `bunx` to run executable npm packages
|
|
44
29
|
|
|
45
30
|
### TypeScript Code Style Guide
|
|
46
31
|
|
|
@@ -59,10 +44,13 @@ see @.cursor/rules/typescript.mdc
|
|
|
59
44
|
Testing work follows the Rule-Aware Task Execution system above.
|
|
60
45
|
|
|
61
46
|
- **Required Rule**: `testing-guide/testing-guide.mdc`
|
|
62
|
-
- **Command**:
|
|
47
|
+
- **Command**:
|
|
48
|
+
- web: `bunx vitest run --silent='passed-only' '[file-path-pattern]'`
|
|
49
|
+
- packages(eg: database): `cd packages/database && bunx vitest run --silent='passed-only' '[file-path-pattern]'`
|
|
63
50
|
|
|
64
51
|
**Important**:
|
|
65
52
|
|
|
53
|
+
- wrapped the file path in single quotes to avoid shell expansion
|
|
66
54
|
- Never run `bun run test` etc to run tests, this will run all tests and cost about 10mins
|
|
67
55
|
- If try to fix the same test twice, but still failed, stop and ask for help.
|
|
68
56
|
|
|
@@ -91,12 +79,13 @@ Some useful rules of this project. Read them when needed.
|
|
|
91
79
|
- `react-component.mdc` - antd-style, Lobe UI usage
|
|
92
80
|
- `drizzle-schema-style-guide.mdc` - Schema naming, patterns
|
|
93
81
|
- `define-database-model.mdc` - Model templates, CRUD patterns
|
|
82
|
+
- `i18n.mdc` - Internationalization workflow
|
|
94
83
|
|
|
95
84
|
**State & UI**
|
|
96
85
|
|
|
97
86
|
- `zustand-slice-organization.mdc` - Store organization
|
|
98
87
|
- `zustand-action-patterns.mdc` - Action patterns
|
|
99
|
-
- `packages/react-layout-kit.mdc` -
|
|
88
|
+
- `packages/react-layout-kit.mdc` - flex layout components usage
|
|
100
89
|
|
|
101
90
|
**Testing & Quality**
|
|
102
91
|
|
|
@@ -110,8 +99,3 @@ Some useful rules of this project. Read them when needed.
|
|
|
110
99
|
- `desktop-menu-configuration.mdc` - App menu, context menu, tray menu
|
|
111
100
|
- `desktop-window-management.mdc` - Window creation, state management, multi-window
|
|
112
101
|
- `desktop-controller-tests.mdc` - Controller unit testing guide
|
|
113
|
-
|
|
114
|
-
**Development Tools**
|
|
115
|
-
|
|
116
|
-
- `i18n.mdc` - Internationalization workflow
|
|
117
|
-
- `debug.mdc` - Debugging strategies
|
package/Dockerfile
CHANGED
|
@@ -249,7 +249,11 @@ ENV \
|
|
|
249
249
|
# Infini-AI
|
|
250
250
|
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST="" \
|
|
251
251
|
# 302.AI
|
|
252
|
-
AI302_API_KEY="" AI302_MODEL_LIST=""
|
|
252
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
253
|
+
# FAL
|
|
254
|
+
FAL_API_KEY="" FAL_MODEL_LIST="" \
|
|
255
|
+
# BFL
|
|
256
|
+
BFL_API_KEY="" BFL_MODEL_LIST=""
|
|
253
257
|
|
|
254
258
|
USER nextjs
|
|
255
259
|
|
package/Dockerfile.database
CHANGED
|
@@ -291,7 +291,11 @@ ENV \
|
|
|
291
291
|
# Infini-AI
|
|
292
292
|
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST="" \
|
|
293
293
|
# 302.AI
|
|
294
|
-
AI302_API_KEY="" AI302_MODEL_LIST=""
|
|
294
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
295
|
+
# FAL
|
|
296
|
+
FAL_API_KEY="" FAL_MODEL_LIST="" \
|
|
297
|
+
# BFL
|
|
298
|
+
BFL_API_KEY="" BFL_MODEL_LIST=""
|
|
295
299
|
|
|
296
300
|
USER nextjs
|
|
297
301
|
|
package/Dockerfile.pglite
CHANGED
|
@@ -247,7 +247,11 @@ ENV \
|
|
|
247
247
|
# Infini-AI
|
|
248
248
|
INFINIAI_API_KEY="" INFINIAI_MODEL_LIST="" \
|
|
249
249
|
# 302.AI
|
|
250
|
-
AI302_API_KEY="" AI302_MODEL_LIST=""
|
|
250
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
251
|
+
# FAL
|
|
252
|
+
FAL_API_KEY="" FAL_MODEL_LIST="" \
|
|
253
|
+
# BFL
|
|
254
|
+
BFL_API_KEY="" BFL_MODEL_LIST=""
|
|
251
255
|
|
|
252
256
|
USER nextjs
|
|
253
257
|
|
package/changelog/v1.json
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"children": {
|
|
4
|
+
"features": [
|
|
5
|
+
"Add gemini 2.5 flash image for vertex ai."
|
|
6
|
+
]
|
|
7
|
+
},
|
|
8
|
+
"date": "2025-08-27",
|
|
9
|
+
"version": "1.116.0"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"children": {},
|
|
13
|
+
"date": "2025-08-26",
|
|
14
|
+
"version": "1.115.0"
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"children": {},
|
|
4
18
|
"date": "2025-08-22",
|
|
@@ -456,7 +456,7 @@ The project uses vitest for unit testing.
|
|
|
456
456
|
|
|
457
457
|
Since our two new configuration fields are both optional, theoretically you could pass the tests without updating them. However, since we added the `openingQuestions` field to the `DEFAULT_AGENT_CONFIG` mentioned earlier, this causes many tests to calculate configurations that include this field, so we still need to update some test snapshots.
|
|
458
458
|
|
|
459
|
-
For the current scenario, I recommend running the tests locally to see which tests fail, and then update them as needed. For example, for the test file `src/store/agent/slices/chat/selectors/agent.test.ts`, you need to run `
|
|
459
|
+
For the current scenario, I recommend running the tests locally to see which tests fail, and then update them as needed. For example, for the test file `src/store/agent/slices/chat/selectors/agent.test.ts`, you need to run `bunx vitest -u src/store/agent/slices/chat/selectors/agent.test.ts` to update the snapshot.
|
|
460
460
|
|
|
461
461
|
## Summary
|
|
462
462
|
|
|
@@ -456,7 +456,7 @@ export default WelcomeMessage;
|
|
|
456
456
|
|
|
457
457
|
由于我们目前两个新的配置字段都是可选的,所以理论上你不更新测试也能跑通,不过由于我们把前面提到的默认配置 `DEFAULT_AGENT_CONFIG` 增加了 `openingQuestions` 字段,这导致很多测试计算出的配置都是有这个字段的,因此我们还是需要更新一部分测试的快照。
|
|
458
458
|
|
|
459
|
-
对于当前这个场景,我建议是本地直接跑下测试,看哪些测试失败了,针对需要更新,例如测试文件 `src/store/agent/slices/chat/selectors/agent.test.ts` 需要执行一下 `
|
|
459
|
+
对于当前这个场景,我建议是本地直接跑下测试,看哪些测试失败了,针对需要更新,例如测试文件 `src/store/agent/slices/chat/selectors/agent.test.ts` 需要执行一下 `bunx vitest -u src/store/agent/slices/chat/selectors/agent.test.ts` 更新快照。
|
|
460
460
|
|
|
461
461
|
## 总结
|
|
462
462
|
|
|
@@ -17,10 +17,14 @@ Before starting development on LobeChat, you need to install and configure some
|
|
|
17
17
|
First, you need to install the following software:
|
|
18
18
|
|
|
19
19
|
- Node.js: LobeChat is built on Node.js, so you need to install Node.js. We recommend installing the latest stable version.
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- PNPM: We use PNPM as the preferred package manager. You can download and install it from the [PNPM official website](https://pnpm.io/installation).
|
|
21
|
+
- Bun: We use Bun as the npm scripts runner. You can download and install it from the [Bun official website](https://bun.com/docs/installation).
|
|
22
22
|
- Git: We use Git for version control. You can download and install it from the Git official website.
|
|
23
|
-
- IDE: You can choose your preferred integrated development environment (IDE). We recommend using WebStorm
|
|
23
|
+
- IDE: You can choose your preferred integrated development environment (IDE). We recommend using WebStorm/VSCode.
|
|
24
|
+
|
|
25
|
+
### VSCode Users
|
|
26
|
+
|
|
27
|
+
We recommend installing the extensions listed in [.vscode/extensions.json](https://github.com/lobehub/lobe-chat/blob/main/.vscode/extensions.json) for the best development experience.
|
|
24
28
|
|
|
25
29
|
### Project Setup
|
|
26
30
|
|
|
@@ -32,24 +36,17 @@ After installing the above software, you can start setting up the LobeChat proje
|
|
|
32
36
|
git clone https://github.com/lobehub/lobe-chat.git
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
2. **Install dependencies**: Then, navigate to the project directory and use
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
cd lobe-chat
|
|
39
|
-
yarn install
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
If you are using PNPM, you can execute:
|
|
39
|
+
2. **Install dependencies**: Then, navigate to the project directory and use PNPM to install the project's dependencies:
|
|
43
40
|
|
|
44
41
|
```bash
|
|
45
42
|
cd lobe-chat
|
|
46
|
-
pnpm
|
|
43
|
+
pnpm i
|
|
47
44
|
```
|
|
48
45
|
|
|
49
46
|
3. **Start the development server**: After installing the dependencies, you can start the development server:
|
|
50
47
|
|
|
51
48
|
```bash
|
|
52
|
-
|
|
49
|
+
bun run dev
|
|
53
50
|
```
|
|
54
51
|
|
|
55
52
|
Now, you can open `http://localhost:3010` in your browser, and you should see the welcome page of LobeChat. This indicates that you have successfully set up the development environment.
|
|
@@ -17,10 +17,14 @@
|
|
|
17
17
|
首先,你需要安装以下软件:
|
|
18
18
|
|
|
19
19
|
- Node.js:LobeChat 是基于 Node.js 构建的,因此你需要安装 Node.js。我们建议安装最新的稳定版。
|
|
20
|
-
-
|
|
21
|
-
-
|
|
20
|
+
- PNPM:我们使用 PNPM 作为管理器。你可以从 [pnpm 的官方网站](https://pnpm.io/installation) 上下载并安装。
|
|
21
|
+
- Bun:我们使用 Bun 作为 npm scripts runner, 你可以从 [Bun 的官方网站](https://bun.com/docs/installation) 上下载并安装。
|
|
22
22
|
- Git:我们使用 Git 进行版本控制。你可以从 Git 的官方网站上下载并安装。
|
|
23
|
-
- IDE:你可以选择你喜欢的集成开发环境(IDE
|
|
23
|
+
- IDE:你可以选择你喜欢的集成开发环境(IDE),我们推荐使用 WebStorm/VSCode。
|
|
24
|
+
|
|
25
|
+
### VSCode 用户
|
|
26
|
+
|
|
27
|
+
推荐安装 [.vscode/extensions.json](https://github.com/lobehub/lobe-chat/blob/main/.vscode/extensions.json) 中推荐安装的扩展获得最佳开发体验。
|
|
24
28
|
|
|
25
29
|
### 项目设置
|
|
26
30
|
|
|
@@ -32,14 +36,7 @@
|
|
|
32
36
|
git clone https://github.com/lobehub/lobe-chat.git
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
2. **安装依赖**:然后,进入项目目录,并使用
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
cd lobe-chat
|
|
39
|
-
bun i
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
如果你使用 pnpm ,可以执行:
|
|
39
|
+
2. **安装依赖**:然后,进入项目目录,并使用 `pnpm` 安装项目的依赖包:
|
|
43
40
|
|
|
44
41
|
```bash
|
|
45
42
|
cd lobe-chat
|
|
@@ -54,7 +51,7 @@ bun run dev
|
|
|
54
51
|
|
|
55
52
|
现在,你可以在浏览器中打开 `http://localhost:3010`,你应该能看到 LobeChat 的欢迎页面。这表明你已经成功地设置了开发环境。
|
|
56
53
|
|
|
57
|
-

|
|
58
55
|
|
|
59
56
|
在开发过程中,如果你在环境设置上遇到任何问题,或者有任何关于 LobeChat 开发的问题,欢迎随时向我们提问。我们期待看到你的贡献!
|
|
60
57
|
|
|
@@ -646,8 +646,33 @@ If you need to use Azure OpenAI to provide model services, you can refer to the
|
|
|
646
646
|
- Type: Optional
|
|
647
647
|
- Description: Used to control the FAL model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model. Separate multiple entries with commas. The definition syntax follows the same rules as other providers' model lists.
|
|
648
648
|
- Default: `-`
|
|
649
|
-
- Example: `-all,+
|
|
649
|
+
- Example: `-all,+flux/schnell,+flux-pro/kontext=FLUX.1 Kontext [pro]`
|
|
650
650
|
|
|
651
|
-
The above example disables all models first, then enables `
|
|
651
|
+
The above example disables all models first, then enables `flux/schnell` and `flux-pro/kontext` (displayed as `FLUX.1 Kontext [pro]`).
|
|
652
|
+
|
|
653
|
+
## BFL
|
|
654
|
+
|
|
655
|
+
### `ENABLED_BFL`
|
|
656
|
+
|
|
657
|
+
- Type: Optional
|
|
658
|
+
- Description: Enables BFL as a model provider by default. Set to `0` to disable the BFL service.
|
|
659
|
+
- Default: `1`
|
|
660
|
+
- Example: `0`
|
|
661
|
+
|
|
662
|
+
### `BFL_API_KEY`
|
|
663
|
+
|
|
664
|
+
- Type: Required
|
|
665
|
+
- Description: This is the API key you applied for in the BFL service.
|
|
666
|
+
- Default: -
|
|
667
|
+
- Example: `12345678-1234-1234-1234-123456789abc`
|
|
668
|
+
|
|
669
|
+
### `BFL_MODEL_LIST`
|
|
670
|
+
|
|
671
|
+
- Type: Optional
|
|
672
|
+
- Description: Used to control the BFL model list. Use `+` to add a model, `-` to hide a model, and `model_name=display_name` to customize the display name of a model. Separate multiple entries with commas. The definition syntax follows the same rules as other providers' model lists.
|
|
673
|
+
- Default: `-`
|
|
674
|
+
- Example: `-all,+flux-pro-1.1,+flux-kontext-pro=FLUX.1 Kontext [pro]`
|
|
675
|
+
|
|
676
|
+
The above example disables all models first, then enables `flux-pro-1.1` and `flux-kontext-pro` (displayed as `FLUX.1 Kontext [pro]`).
|
|
652
677
|
|
|
653
678
|
[model-list]: /docs/self-hosting/advanced/model-list
|
|
@@ -645,8 +645,33 @@ LobeChat 在部署时提供了丰富的模型服务商相关的环境变量,
|
|
|
645
645
|
- 类型:可选
|
|
646
646
|
- 描述:用来控制 FAL 模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则与其他 provider 保持一致。
|
|
647
647
|
- 默认值:`-`
|
|
648
|
-
- 示例:`-all,+
|
|
648
|
+
- 示例:`-all,+flux/schnell,+flux-pro/kontext=FLUX.1 Kontext [pro]`
|
|
649
649
|
|
|
650
|
-
上述示例表示先禁用所有模型,再启用 `
|
|
650
|
+
上述示例表示先禁用所有模型,再启用 `flux/schnell` 和 `flux-pro/kontext`(显示名为 `FLUX.1 Kontext [pro]`)。
|
|
651
|
+
|
|
652
|
+
## BFL
|
|
653
|
+
|
|
654
|
+
### `ENABLED_BFL`
|
|
655
|
+
|
|
656
|
+
- 类型:可选
|
|
657
|
+
- 描述:默认启用 BFL 作为模型供应商,当设为 0 时关闭 BFL 服务
|
|
658
|
+
- 默认值:`1`
|
|
659
|
+
- 示例:`0`
|
|
660
|
+
|
|
661
|
+
### `BFL_API_KEY`
|
|
662
|
+
|
|
663
|
+
- 类型:必选
|
|
664
|
+
- 描述:这是你在 BFL 服务中申请的 API 密钥
|
|
665
|
+
- 默认值:-
|
|
666
|
+
- 示例:`12345678-1234-1234-1234-123456789abc`
|
|
667
|
+
|
|
668
|
+
### `BFL_MODEL_LIST`
|
|
669
|
+
|
|
670
|
+
- 类型:可选
|
|
671
|
+
- 描述:用来控制 BFL 模型列表,使用 `+` 增加一个模型,使用 `-` 来隐藏一个模型,使用 `模型名=展示名` 来自定义模型的展示名,用英文逗号隔开。模型定义语法规则与其他 provider 保持一致。
|
|
672
|
+
- 默认值:`-`
|
|
673
|
+
- 示例:`-all,+flux-pro-1.1,+flux-kontext-pro=FLUX.1 Kontext [pro]`
|
|
674
|
+
|
|
675
|
+
上述示例表示先禁用所有模型,再启用 `flux-pro-1.1` 和 `flux-kontext-pro`(显示名为 `FLUX.1 Kontext [pro]`)。
|
|
651
676
|
|
|
652
677
|
[model-list]: /zh/docs/self-hosting/advanced/model-list
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Using Black Forest Labs API Key in LobeChat
|
|
3
|
+
description: >-
|
|
4
|
+
Learn how to integrate Black Forest Labs API Key in LobeChat for AI image generation using advanced models and high-quality output.
|
|
5
|
+
|
|
6
|
+
tags:
|
|
7
|
+
- Black Forest Labs
|
|
8
|
+
- Image Generation
|
|
9
|
+
- API Key
|
|
10
|
+
- Web UI
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Using Black Forest Labs in LobeChat
|
|
14
|
+
|
|
15
|
+
<Image alt={'Using Black Forest Labs in LobeChat'} cover src={'https://hub-apac-1.lobeobjects.space/docs/bfl-cover-image.png'} />
|
|
16
|
+
|
|
17
|
+
[Black Forest Labs](https://bfl.ai/) is currently the world's top-tier AI image generation research lab, having developed the FLUX series of high-quality image generation models and the FLUX Kontext series of image editing models. This document will guide you on how to use Black Forest Labs in LobeChat:
|
|
18
|
+
|
|
19
|
+
<Steps>
|
|
20
|
+
### Step 1: Obtain Black Forest Labs API Key
|
|
21
|
+
|
|
22
|
+
- Register for a [Black Forest Labs account](https://auth.bfl.ai/).
|
|
23
|
+
- Navigate to the [API Keys dashboard](https://dashboard.bfl.ai/api/keys) and click **Add Key** to generate a new API key.
|
|
24
|
+
- Copy the generated API key and keep it secure; it will only be shown once.
|
|
25
|
+
|
|
26
|
+
<Image
|
|
27
|
+
alt={'Open the API dashboard'}
|
|
28
|
+
inStep
|
|
29
|
+
src={
|
|
30
|
+
'https://hub-apac-1.lobeobjects.space/docs/36331f581e36a72ba91fb6c1dacbedd4.png'
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<Image
|
|
35
|
+
alt={'Create API Key'}
|
|
36
|
+
inStep
|
|
37
|
+
src={
|
|
38
|
+
'https://hub-apac-1.lobeobjects.space/docs/3049ad79746bf913d1b2736cfe1d38fa.png'
|
|
39
|
+
}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<Image
|
|
43
|
+
alt={'Retrieve API Key'}
|
|
44
|
+
inStep
|
|
45
|
+
src={
|
|
46
|
+
'https://hub-apac-1.lobeobjects.space/docs/33143deb04f2a0cdb2fd543ff8161633.png'
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
### Step 2: Configure Black Forest Labs in LobeChat
|
|
51
|
+
|
|
52
|
+
- Visit the `Settings` page in LobeChat.
|
|
53
|
+
- Under **AI Service Provider**, locate the **Black Forest Labs** configuration section.
|
|
54
|
+
|
|
55
|
+
<Image alt={'Enter API Key'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/4fe1993d94fad72829612d22527a2ecd.png'} />
|
|
56
|
+
|
|
57
|
+
- Paste the API key you obtained.
|
|
58
|
+
- Choose a Black Forest Labs model for image generation.
|
|
59
|
+
|
|
60
|
+
<Image alt={'Select Black Forest Labs model for image generation'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/7a6dfdb1a1bdd5443104a6d2cb3a8bf4.png'} />
|
|
61
|
+
|
|
62
|
+
<Callout type={'warning'}>
|
|
63
|
+
During usage, you may incur charges according to Black Forest Labs's pricing policy. Please review Black Forest Labs's
|
|
64
|
+
official pricing before heavy usage.
|
|
65
|
+
</Callout>
|
|
66
|
+
</Steps>
|
|
67
|
+
|
|
68
|
+
You can now use Black Forest Labs's advanced image generation models directly within LobeChat to create stunning visual content.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 在 LobeChat 中使用 Black Forest Labs API Key
|
|
3
|
+
description: >-
|
|
4
|
+
学习如何在 LobeChat 中配置和使用 Black Forest Labs API Key,使用先进模型进行高质量 AI 图像生成。
|
|
5
|
+
|
|
6
|
+
tags:
|
|
7
|
+
- Black Forest Labs
|
|
8
|
+
- 图像生成
|
|
9
|
+
- API Key
|
|
10
|
+
- Web UI
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# 在 LobeChat 中使用 Black Forest Labs
|
|
14
|
+
|
|
15
|
+
<Image alt={'在 LobeChat 中使用 Black Forest Labs'} cover src={'https://hub-apac-1.lobeobjects.space/docs/bfl-cover-image.png'} />
|
|
16
|
+
|
|
17
|
+
[Black Forest Labs](https://bfl.ai/) 是当前世界最顶级的 AI 图像生成实验室团队,研发了 FLUX 系列高质量图像生成模型,FLUX Kontext 系列图像编辑模型。本文将指导你如何在 LobeChat 中使用 Black Forest Labs:
|
|
18
|
+
|
|
19
|
+
<Steps>
|
|
20
|
+
### 步骤一:获取 Black Forest Labs API Key
|
|
21
|
+
|
|
22
|
+
- 注册 [Black Forest Labs](https://auth.bfl.ai/) 账户;
|
|
23
|
+
- 前往 [API Keys 控制台](https://dashboard.bfl.ai/api/keys),点击 **Add Key** 创建新的 API 密钥;
|
|
24
|
+
- 复制生成的 API Key 并妥善保存,它只会显示一次。
|
|
25
|
+
|
|
26
|
+
<Image
|
|
27
|
+
alt={'打开 API 控制台'}
|
|
28
|
+
inStep
|
|
29
|
+
src={
|
|
30
|
+
'https://hub-apac-1.lobeobjects.space/docs/36331f581e36a72ba91fb6c1dacbedd4.png'
|
|
31
|
+
}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<Image
|
|
35
|
+
alt={'创建 API Key'}
|
|
36
|
+
inStep
|
|
37
|
+
src={
|
|
38
|
+
'https://hub-apac-1.lobeobjects.space/docs/3049ad79746bf913d1b2736cfe1d38fa.png'
|
|
39
|
+
}
|
|
40
|
+
/>
|
|
41
|
+
|
|
42
|
+
<Image
|
|
43
|
+
alt={'获取 API Key'}
|
|
44
|
+
inStep
|
|
45
|
+
src={
|
|
46
|
+
'https://hub-apac-1.lobeobjects.space/docs/33143deb04f2a0cdb2fd543ff8161633.png'
|
|
47
|
+
}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
### 步骤二:在 LobeChat 中配置 Black Forest Labs
|
|
51
|
+
|
|
52
|
+
- 访问 LobeChat 的 `设置` 页面;
|
|
53
|
+
- 在 `AI服务商` 下找到 `Black Forest Labs` 的设置项;
|
|
54
|
+
|
|
55
|
+
<Image alt={'填入 API 密钥'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/4fe1993d94fad72829612d22527a2ecd.png'} />
|
|
56
|
+
|
|
57
|
+
- 粘贴获取到的 API Key;
|
|
58
|
+
- 选择一个 Black Forest Labs 模型用于图像生成。
|
|
59
|
+
|
|
60
|
+
<Image alt={'选择 Black Forest Labs 模型进行图像生成'} inStep src={'https://hub-apac-1.lobeobjects.space/docs/7a6dfdb1a1bdd5443104a6d2cb3a8bf4.png'} />
|
|
61
|
+
|
|
62
|
+
<Callout type={'warning'}>
|
|
63
|
+
在使用过程中,你可能需要向 Black Forest Labs 支付相应费用,请在大量调用前查阅 Black Forest Labs 的官方计费政策。
|
|
64
|
+
</Callout>
|
|
65
|
+
</Steps>
|
|
66
|
+
|
|
67
|
+
至此,你已经可以在 LobeChat 中使用 Black Forest Labs 提供的先进图像生成模型来创作精美的视觉内容了。
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
+
"ArgsInput": {
|
|
3
|
+
"addArgument": "إضافة معامل",
|
|
4
|
+
"argumentPlaceholder": "المعامل {{index}}",
|
|
5
|
+
"enterFirstArgument": "أدخل المعامل الأول..."
|
|
6
|
+
},
|
|
2
7
|
"DragUpload": {
|
|
3
8
|
"dragDesc": "اسحب الملفات هنا، يدعم تحميل عدة صور.",
|
|
4
9
|
"dragFileDesc": "اسحب الصور والملفات هنا، يدعم تحميل عدة صور وملفات.",
|
|
@@ -125,6 +130,12 @@
|
|
|
125
130
|
},
|
|
126
131
|
"progress": {
|
|
127
132
|
"uploadingWithCount": "تم تحميل {{completed}} من أصل {{total}}"
|
|
133
|
+
},
|
|
134
|
+
"validation": {
|
|
135
|
+
"fileSizeExceeded": "تجاوز حجم الملف الحد المسموح به",
|
|
136
|
+
"fileSizeExceededDetail": "{{fileName}} ({{actualSize}}) يتجاوز الحد الأقصى للحجم وهو {{maxSize}}",
|
|
137
|
+
"fileSizeExceededMultiple": "{{count}} من الملفات تتجاوز الحد الأقصى للحجم {{maxSize}}: {{fileList}}",
|
|
138
|
+
"imageCountExceeded": "تجاوز عدد الصور الحد المسموح به"
|
|
128
139
|
}
|
|
129
140
|
},
|
|
130
141
|
"OllamaSetupGuide": {
|
package/locales/ar/error.json
CHANGED
|
@@ -85,6 +85,17 @@
|
|
|
85
85
|
"CreateMessageError": "عذرًا، لم يتم إرسال الرسالة بشكل صحيح، يرجى نسخ المحتوى وإعادة إرساله، بعد تحديث الصفحة لن يتم الاحتفاظ بهذه الرسالة",
|
|
86
86
|
"ExceededContextWindow": "المحتوى المطلوب الحالي يتجاوز الطول الذي يمكن للنموذج معالجته، يرجى تقليل كمية المحتوى ثم إعادة المحاولة",
|
|
87
87
|
"FreePlanLimit": "أنت حاليًا مستخدم مجاني، لا يمكنك استخدام هذه الوظيفة، يرجى الترقية إلى خطة مدفوعة للمتابعة",
|
|
88
|
+
"GoogleAIBlockReason": {
|
|
89
|
+
"BLOCKLIST": "يحتوي محتواك على كلمات محظورة. الرجاء التحقق من مدخلاتك وتعديلها ثم المحاولة مرة أخرى.",
|
|
90
|
+
"IMAGE_SAFETY": "تم حظر المحتوى الصوري لأسباب تتعلق بالسلامة. يرجى محاولة تعديل طلب إنشاء الصورة.",
|
|
91
|
+
"LANGUAGE": "اللغة التي استخدمتها غير مدعومة حالياً. يرجى المحاولة مرة أخرى باستخدام الإنجليزية أو إحدى اللغات المدعومة.",
|
|
92
|
+
"OTHER": "تم حظر المحتوى لسبب غير معروف. يرجى محاولة إعادة صياغة طلبك.",
|
|
93
|
+
"PROHIBITED_CONTENT": "قد يحتوي طلبك على محتوى محظور. يرجى تعديل طلبك والتأكد من أن المحتوى يلتزم بسياسات الاستخدام.",
|
|
94
|
+
"RECITATION": "تم حظر المحتوى لأنه قد ينطوي على مسائل حقوق نشر. يرجى محاولة استخدام محتوى أصلي أو إعادة صياغة طلبك.",
|
|
95
|
+
"SAFETY": "تم حظر المحتوى بسبب سياسات الأمان. يرجى محاولة تعديل طلبك وتجنب تضمين محتوى قد يكون ضاراً أو غير مناسب.",
|
|
96
|
+
"SPII": "قد يحتوي محتواك على معلومات شخصية حساسة. لحماية الخصوصية، يرجى إزالة المعلومات الحساسة ثم المحاولة مرة أخرى.",
|
|
97
|
+
"default": "تم حظر المحتوى: {{blockReason}}。请调整您的请求内容后重试。"
|
|
98
|
+
},
|
|
88
99
|
"InsufficientQuota": "عذرًا، لقد reached الحد الأقصى للحصة (quota) لهذه المفتاح، يرجى التحقق من رصيد الحساب الخاص بك أو زيادة حصة المفتاح ثم المحاولة مرة أخرى",
|
|
89
100
|
"InvalidAccessCode": "كلمة المرور غير صحيحة أو فارغة، يرجى إدخال كلمة مرور الوصول الصحيحة أو إضافة مفتاح API مخصص",
|
|
90
101
|
"InvalidBedrockCredentials": "فشلت مصادقة Bedrock، يرجى التحقق من AccessKeyId/SecretAccessKey وإعادة المحاولة",
|