@lobehub/chat 1.115.0 → 1.116.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/.cursor/rules/add-provider-doc.mdc +183 -0
- package/.env.example +8 -0
- package/.github/workflows/claude.yml +1 -1
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/test.yml +3 -7
- package/CHANGELOG.md +42 -0
- package/CLAUDE.md +6 -6
- package/Dockerfile +5 -1
- package/Dockerfile.database +5 -1
- package/Dockerfile.pglite +5 -1
- package/changelog/v1.json +14 -0
- package/docs/development/basic/setup-development.mdx +10 -13
- package/docs/development/basic/setup-development.zh-CN.mdx +9 -12
- package/docs/development/database-schema.dbml +44 -0
- 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 +1 -1
- package/packages/database/migrations/0030_add_group_chat.sql +36 -0
- package/packages/database/migrations/meta/0030_snapshot.json +6417 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/core/migrations.json +19 -0
- package/packages/database/src/models/__tests__/topic.test.ts +3 -1
- package/packages/database/src/repositories/tableViewer/index.test.ts +1 -1
- package/packages/database/src/schemas/chatGroup.ts +98 -0
- package/packages/database/src/schemas/index.ts +1 -0
- package/packages/database/src/schemas/message.ts +4 -1
- package/packages/database/src/schemas/relations.ts +26 -0
- package/packages/database/src/schemas/topic.ts +2 -0
- package/packages/database/src/types/chatGroup.ts +9 -0
- package/packages/database/src/utils/idGenerator.ts +1 -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 +17 -8
- package/packages/model-runtime/src/utils/streams/google-ai.ts +26 -14
- package/packages/types/src/aiModel.ts +2 -1
- 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/features/FileViewer/Renderer/PDF/index.tsx +2 -2
- package/.cursor/rules/debug.mdc +0 -193
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Complete guide for adding a new AI provider documentation to LobeChat
|
|
3
|
+
alwaysApply: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Adding New AI Provider Documentation
|
|
7
|
+
|
|
8
|
+
This document provides a step-by-step guide for adding documentation for a new AI provider to LobeChat, based on the complete workflow used for adding providers like BFL (Black Forest Labs) and FAL.
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Adding a new provider requires creating both user-facing documentation and technical configuration files. The process involves:
|
|
13
|
+
|
|
14
|
+
1. Creating usage documentation (EN + CN)
|
|
15
|
+
2. Adding environment variable documentation (EN + CN)
|
|
16
|
+
3. Updating Docker configuration files
|
|
17
|
+
4. Updating .env.example file
|
|
18
|
+
5. Preparing image resources
|
|
19
|
+
|
|
20
|
+
## Step 1: Create Provider Usage Documentation
|
|
21
|
+
|
|
22
|
+
Create user-facing documentation that explains how to use the new provider.
|
|
23
|
+
|
|
24
|
+
### Required Files
|
|
25
|
+
|
|
26
|
+
Create both English and Chinese versions:
|
|
27
|
+
- `docs/usage/providers/{provider-name}.mdx` (English)
|
|
28
|
+
- `docs/usage/providers/{provider-name}.zh-CN.mdx` (Chinese)
|
|
29
|
+
|
|
30
|
+
### Documentation Structure
|
|
31
|
+
|
|
32
|
+
Follow the structure and format used in existing provider documentation. For reference, see:
|
|
33
|
+
- `docs/usage/providers/fal.mdx` (English template)
|
|
34
|
+
- `docs/usage/providers/fal.zh-CN.mdx` (Chinese template)
|
|
35
|
+
|
|
36
|
+
### Key Requirements
|
|
37
|
+
|
|
38
|
+
- **Images**: Prepare 5-6 screenshots showing the process
|
|
39
|
+
- **Cover Image**: Create or obtain a cover image for the provider
|
|
40
|
+
- **Accurate URLs**: Use real registration and dashboard URLs
|
|
41
|
+
- **Service Type**: Specify whether it's for image generation, text generation, etc.
|
|
42
|
+
- **Pricing Warning**: Include pricing information callout
|
|
43
|
+
|
|
44
|
+
### Important Notes
|
|
45
|
+
|
|
46
|
+
- **🔒 API Key Security**: Never include real API keys in documentation. Always use placeholder format (e.g., `bfl-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`)
|
|
47
|
+
- **🖼️ Image Hosting**: Use LobeHub's CDN for all images: `hub-apac-1.lobeobjects.space`
|
|
48
|
+
|
|
49
|
+
## Step 2: Update Environment Variables Documentation
|
|
50
|
+
|
|
51
|
+
Add the new provider's environment variables to the self-hosting documentation.
|
|
52
|
+
|
|
53
|
+
### Files to Update
|
|
54
|
+
|
|
55
|
+
- `docs/self-hosting/environment-variables/model-provider.mdx` (English)
|
|
56
|
+
- `docs/self-hosting/environment-variables/model-provider.zh-CN.mdx` (Chinese)
|
|
57
|
+
|
|
58
|
+
### Content to Add
|
|
59
|
+
|
|
60
|
+
Add two sections for each provider:
|
|
61
|
+
|
|
62
|
+
```markdown
|
|
63
|
+
### `{PROVIDER}_API_KEY`
|
|
64
|
+
|
|
65
|
+
- Type: Required
|
|
66
|
+
- Description: This is the API key you applied for in the {Provider Name} service.
|
|
67
|
+
- Default: -
|
|
68
|
+
- Example: `{api-key-format-example}`
|
|
69
|
+
|
|
70
|
+
### `{PROVIDER}_MODEL_LIST`
|
|
71
|
+
|
|
72
|
+
- Type: Optional
|
|
73
|
+
- Description: Used to control the {Provider Name} 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.
|
|
74
|
+
- Default: `-`
|
|
75
|
+
- Example: `-all,+{model-id-1},+{model-id-2}={display-name}`
|
|
76
|
+
|
|
77
|
+
The above example disables all models first, then enables `{model-id-1}` and `{model-id-2}` (displayed as `{display-name}`).
|
|
78
|
+
|
|
79
|
+
[model-list]: /docs/self-hosting/advanced/model-list
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Important Notes
|
|
83
|
+
|
|
84
|
+
- **API Key Format**: Use proper UUID format for examples (e.g., `12345678-1234-1234-1234-123456789abc`)
|
|
85
|
+
- **Real Model IDs**: Use actual model IDs from the codebase, not placeholders
|
|
86
|
+
- **Consistent Naming**: Follow the pattern `{PROVIDER}_API_KEY` and `{PROVIDER}_MODEL_LIST`
|
|
87
|
+
|
|
88
|
+
## Step 3: Update Docker Configuration Files
|
|
89
|
+
|
|
90
|
+
Add environment variables to all Docker configuration files to ensure the provider works in containerized deployments.
|
|
91
|
+
|
|
92
|
+
### Files to Update
|
|
93
|
+
|
|
94
|
+
All Dockerfile variants must be updated:
|
|
95
|
+
- `Dockerfile`
|
|
96
|
+
- `Dockerfile.database`
|
|
97
|
+
- `Dockerfile.pglite`
|
|
98
|
+
|
|
99
|
+
### Changes Required
|
|
100
|
+
|
|
101
|
+
Add the new provider's environment variables at the **end** of the ENV section, just before the final line:
|
|
102
|
+
|
|
103
|
+
```dockerfile
|
|
104
|
+
# Previous providers...
|
|
105
|
+
# 302.AI
|
|
106
|
+
AI302_API_KEY="" AI302_MODEL_LIST="" \
|
|
107
|
+
# {New Provider 1}
|
|
108
|
+
{PROVIDER1}_API_KEY="" {PROVIDER1}_MODEL_LIST="" \
|
|
109
|
+
# {New Provider 2}
|
|
110
|
+
{PROVIDER2}_API_KEY="" {PROVIDER2}_MODEL_LIST=""
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Important Rules
|
|
114
|
+
|
|
115
|
+
- **Position**: Add new providers at the **end** of the list
|
|
116
|
+
- **Ordering**: When adding multiple providers, use alphabetical order (e.g., FAL before BFL)
|
|
117
|
+
- **Consistency**: Maintain identical ordering across all Dockerfile variants
|
|
118
|
+
- **Format**: Follow the pattern `{PROVIDER}_API_KEY="" {PROVIDER}_MODEL_LIST="" \`
|
|
119
|
+
|
|
120
|
+
## Step 4: Update .env.example File
|
|
121
|
+
|
|
122
|
+
Add example configuration entries to help users understand how to configure the provider locally.
|
|
123
|
+
|
|
124
|
+
### File to Update
|
|
125
|
+
|
|
126
|
+
- `.env.example`
|
|
127
|
+
|
|
128
|
+
### Content to Add
|
|
129
|
+
|
|
130
|
+
Add new sections before the "Market Service" section:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
### {Provider Name} ###
|
|
134
|
+
|
|
135
|
+
# {PROVIDER}_API_KEY={provider-prefix}-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Format Guidelines
|
|
139
|
+
|
|
140
|
+
- **Section Header**: Use `### {Provider Name} ###` format
|
|
141
|
+
- **Commented Example**: Use `#` to comment out the example
|
|
142
|
+
- **Key Format**: Use appropriate prefix for the provider (e.g., `bfl-`, `fal-`, `sk-`)
|
|
143
|
+
- **Position**: Add before the Market Service section
|
|
144
|
+
- **Spacing**: Maintain consistent spacing with existing entries
|
|
145
|
+
|
|
146
|
+
## Step 5: Image Resources
|
|
147
|
+
|
|
148
|
+
Prepare all necessary image resources for the documentation.
|
|
149
|
+
|
|
150
|
+
### Required Images
|
|
151
|
+
|
|
152
|
+
1. **Cover Image**: Provider logo or branded image
|
|
153
|
+
2. **API Dashboard Screenshots**: 3-4 screenshots showing API key creation process
|
|
154
|
+
3. **LobeChat Configuration Screenshots**: 2-3 screenshots showing provider setup in LobeChat
|
|
155
|
+
|
|
156
|
+
### Image Guidelines
|
|
157
|
+
|
|
158
|
+
- **Quality**: Use high-resolution screenshots
|
|
159
|
+
- **Consistency**: Maintain consistent styling across all screenshots
|
|
160
|
+
- **Privacy**: Remove or blur any sensitive information
|
|
161
|
+
- **Format**: Use PNG format for screenshots
|
|
162
|
+
- **Hosting**: Use LobeHub's CDN (`hub-apac-1.lobeobjects.space`) for all images
|
|
163
|
+
|
|
164
|
+
## Checklist
|
|
165
|
+
|
|
166
|
+
Before submitting your provider documentation:
|
|
167
|
+
|
|
168
|
+
- [ ] Created both English and Chinese usage documentation
|
|
169
|
+
- [ ] Added environment variable documentation (EN + CN)
|
|
170
|
+
- [ ] Updated all 3 Dockerfile variants with consistent ordering
|
|
171
|
+
- [ ] Updated .env.example with proper key format
|
|
172
|
+
- [ ] Prepared all required screenshots and images
|
|
173
|
+
- [ ] Used actual model IDs from the codebase
|
|
174
|
+
- [ ] Verified no real API keys are included in documentation
|
|
175
|
+
- [ ] Used LobeHub CDN for all image hosting
|
|
176
|
+
- [ ] Tested the documentation for clarity and accuracy
|
|
177
|
+
|
|
178
|
+
## Reference
|
|
179
|
+
|
|
180
|
+
This guide was created based on the implementation of BFL (Black Forest Labs) provider documentation. For a complete example, refer to:
|
|
181
|
+
- Commits: `d2da03e1a` (documentation) and `6a2e95868` (environment variables)
|
|
182
|
+
- Files: `docs/usage/providers/bfl.mdx`, `docs/usage/providers/bfl.zh-CN.mdx`
|
|
183
|
+
- PR: Current branch `tj/feat/bfl-docs`
|
package/.env.example
CHANGED
|
@@ -153,6 +153,14 @@ OPENAI_API_KEY=sk-xxxxxxxxx
|
|
|
153
153
|
|
|
154
154
|
# AIHUBMIX_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
155
155
|
|
|
156
|
+
### BFL ###
|
|
157
|
+
|
|
158
|
+
# BFL_API_KEY=bfl-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
159
|
+
|
|
160
|
+
### FAL ###
|
|
161
|
+
|
|
162
|
+
# FAL_API_KEY=fal-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
163
|
+
|
|
156
164
|
|
|
157
165
|
########################################
|
|
158
166
|
############ Market Service ############
|
|
@@ -41,7 +41,7 @@ jobs:
|
|
|
41
41
|
actions: read
|
|
42
42
|
|
|
43
43
|
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
|
|
44
|
-
model: 'claude-opus-4-1-20250805'
|
|
44
|
+
# model: 'claude-opus-4-1-20250805'
|
|
45
45
|
allowed_bots: 'bot'
|
|
46
46
|
|
|
47
47
|
# Optional: Customize the trigger phrase (default: @claude)
|
|
@@ -16,6 +16,8 @@ jobs:
|
|
|
16
16
|
POSTGRES_PASSWORD: postgres
|
|
17
17
|
options: >-
|
|
18
18
|
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
19
|
+
|
|
20
|
+
|
|
19
21
|
ports:
|
|
20
22
|
- 5432:5432
|
|
21
23
|
|
|
@@ -38,10 +40,8 @@ jobs:
|
|
|
38
40
|
- name: Lint
|
|
39
41
|
run: bun run lint
|
|
40
42
|
|
|
41
|
-
- uses: pnpm/action-setup@v4
|
|
42
|
-
|
|
43
43
|
- name: Test Database Coverage
|
|
44
|
-
run:
|
|
44
|
+
run: bun run --filter @lobechat/database test
|
|
45
45
|
env:
|
|
46
46
|
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
|
47
47
|
DATABASE_DRIVER: node
|
|
@@ -23,8 +23,6 @@ jobs:
|
|
|
23
23
|
with:
|
|
24
24
|
node-version: 22
|
|
25
25
|
|
|
26
|
-
- uses: pnpm/action-setup@v4
|
|
27
|
-
|
|
28
26
|
- name: Install bun
|
|
29
27
|
uses: oven-sh/setup-bun@v1
|
|
30
28
|
with:
|
|
@@ -34,7 +32,7 @@ jobs:
|
|
|
34
32
|
run: bun i
|
|
35
33
|
|
|
36
34
|
- name: Test ${{ matrix.package }} package with coverage
|
|
37
|
-
run:
|
|
35
|
+
run: bun run --filter @lobechat/${{ matrix.package }} test:coverage
|
|
38
36
|
|
|
39
37
|
- name: Upload ${{ matrix.package }} coverage to Codecov
|
|
40
38
|
uses: codecov/codecov-action@v4
|
|
@@ -111,17 +109,15 @@ jobs:
|
|
|
111
109
|
- name: Lint
|
|
112
110
|
run: bun run lint
|
|
113
111
|
|
|
114
|
-
- uses: pnpm/action-setup@v4
|
|
115
|
-
|
|
116
112
|
- name: Test Client DB
|
|
117
|
-
run:
|
|
113
|
+
run: bun run --filter @lobechat/database test:client-db
|
|
118
114
|
env:
|
|
119
115
|
KEY_VAULTS_SECRET: LA7n9k3JdEcbSgml2sxfw+4TV1AzaaFU5+R176aQz4s=
|
|
120
116
|
S3_PUBLIC_DOMAIN: https://example.com
|
|
121
117
|
APP_URL: https://home.com
|
|
122
118
|
|
|
123
119
|
- name: Test Coverage
|
|
124
|
-
run:
|
|
120
|
+
run: bun run --filter @lobechat/database test:coverage
|
|
125
121
|
env:
|
|
126
122
|
DATABASE_TEST_URL: postgresql://postgres:postgres@localhost:5432/postgres
|
|
127
123
|
DATABASE_DRIVER: node
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 1.116.1](https://github.com/lobehub/lobe-chat/compare/v1.116.0...v1.116.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2025-08-27**</sup>
|
|
8
|
+
|
|
9
|
+
<br/>
|
|
10
|
+
|
|
11
|
+
<details>
|
|
12
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
13
|
+
|
|
14
|
+
</details>
|
|
15
|
+
|
|
16
|
+
<div align="right">
|
|
17
|
+
|
|
18
|
+
[](#readme-top)
|
|
19
|
+
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
## [Version 1.116.0](https://github.com/lobehub/lobe-chat/compare/v1.115.0...v1.116.0)
|
|
23
|
+
|
|
24
|
+
<sup>Released on **2025-08-27**</sup>
|
|
25
|
+
|
|
26
|
+
#### ✨ Features
|
|
27
|
+
|
|
28
|
+
- **misc**: Add gemini 2.5 flash image for vertex ai.
|
|
29
|
+
|
|
30
|
+
<br/>
|
|
31
|
+
|
|
32
|
+
<details>
|
|
33
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
34
|
+
|
|
35
|
+
#### What's improved
|
|
36
|
+
|
|
37
|
+
- **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))
|
|
38
|
+
|
|
39
|
+
</details>
|
|
40
|
+
|
|
41
|
+
<div align="right">
|
|
42
|
+
|
|
43
|
+
[](#readme-top)
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
5
47
|
## [Version 1.115.0](https://github.com/lobehub/lobe-chat/compare/v1.114.6...v1.115.0)
|
|
6
48
|
|
|
7
49
|
<sup>Released on **2025-08-26**</sup>
|
package/CLAUDE.md
CHANGED
|
@@ -21,7 +21,11 @@ read @.cursor/rules/project-structure.mdc
|
|
|
21
21
|
|
|
22
22
|
### Package Management
|
|
23
23
|
|
|
24
|
-
|
|
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
|
|
28
|
+
- Use `bunx` to run executable npm packages
|
|
25
29
|
|
|
26
30
|
### TypeScript Code Style Guide
|
|
27
31
|
|
|
@@ -75,6 +79,7 @@ Some useful rules of this project. Read them when needed.
|
|
|
75
79
|
- `react-component.mdc` - antd-style, Lobe UI usage
|
|
76
80
|
- `drizzle-schema-style-guide.mdc` - Schema naming, patterns
|
|
77
81
|
- `define-database-model.mdc` - Model templates, CRUD patterns
|
|
82
|
+
- `i18n.mdc` - Internationalization workflow
|
|
78
83
|
|
|
79
84
|
**State & UI**
|
|
80
85
|
|
|
@@ -94,8 +99,3 @@ Some useful rules of this project. Read them when needed.
|
|
|
94
99
|
- `desktop-menu-configuration.mdc` - App menu, context menu, tray menu
|
|
95
100
|
- `desktop-window-management.mdc` - Window creation, state management, multi-window
|
|
96
101
|
- `desktop-controller-tests.mdc` - Controller unit testing guide
|
|
97
|
-
|
|
98
|
-
**Development Tools**
|
|
99
|
-
|
|
100
|
-
- `i18n.mdc` - Internationalization workflow
|
|
101
|
-
- `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
|
+
"date": "2025-08-27",
|
|
5
|
+
"version": "1.116.1"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"children": {
|
|
9
|
+
"features": [
|
|
10
|
+
"Add gemini 2.5 flash image for vertex ai."
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"date": "2025-08-27",
|
|
14
|
+
"version": "1.116.0"
|
|
15
|
+
},
|
|
2
16
|
{
|
|
3
17
|
"children": {},
|
|
4
18
|
"date": "2025-08-26",
|
|
@@ -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
|
|
|
@@ -129,6 +129,39 @@ table async_tasks {
|
|
|
129
129
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
table chat_groups {
|
|
133
|
+
id text [pk, not null]
|
|
134
|
+
title text
|
|
135
|
+
description text
|
|
136
|
+
config jsonb
|
|
137
|
+
client_id text
|
|
138
|
+
user_id text [not null]
|
|
139
|
+
pinned boolean [default: false]
|
|
140
|
+
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
141
|
+
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
142
|
+
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
143
|
+
|
|
144
|
+
indexes {
|
|
145
|
+
(client_id, user_id) [name: 'chat_groups_client_id_user_id_unique', unique]
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
table chat_groups_agents {
|
|
150
|
+
chat_group_id text [not null]
|
|
151
|
+
agent_id text [not null]
|
|
152
|
+
user_id text [not null]
|
|
153
|
+
enabled boolean [default: true]
|
|
154
|
+
order integer [default: 0]
|
|
155
|
+
role text [default: 'participant']
|
|
156
|
+
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
157
|
+
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
158
|
+
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
159
|
+
|
|
160
|
+
indexes {
|
|
161
|
+
(chat_group_id, agent_id) [pk]
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
132
165
|
table document_chunks {
|
|
133
166
|
document_id varchar(30) [not null]
|
|
134
167
|
chunk_id uuid [not null]
|
|
@@ -372,6 +405,8 @@ table messages {
|
|
|
372
405
|
parent_id text
|
|
373
406
|
quota_id text
|
|
374
407
|
agent_id text
|
|
408
|
+
group_id text
|
|
409
|
+
target_id text
|
|
375
410
|
accessed_at "timestamp with time zone" [not null, default: `now()`]
|
|
376
411
|
created_at "timestamp with time zone" [not null, default: `now()`]
|
|
377
412
|
updated_at "timestamp with time zone" [not null, default: `now()`]
|
|
@@ -838,6 +873,7 @@ table topics {
|
|
|
838
873
|
title text
|
|
839
874
|
favorite boolean [default: false]
|
|
840
875
|
session_id text
|
|
876
|
+
group_id text
|
|
841
877
|
user_id text [not null]
|
|
842
878
|
client_id text
|
|
843
879
|
history_summary text
|
|
@@ -909,6 +945,14 @@ ref: agents_to_sessions.session_id > sessions.id
|
|
|
909
945
|
|
|
910
946
|
ref: agents_to_sessions.agent_id > agents.id
|
|
911
947
|
|
|
948
|
+
ref: chat_groups_agents.chat_group_id > chat_groups.id
|
|
949
|
+
|
|
950
|
+
ref: chat_groups_agents.agent_id > agents.id
|
|
951
|
+
|
|
952
|
+
ref: chat_groups_agents.user_id - users.id
|
|
953
|
+
|
|
954
|
+
ref: chat_groups.user_id - users.id
|
|
955
|
+
|
|
912
956
|
ref: unstructured_chunks.file_id - files.id
|
|
913
957
|
|
|
914
958
|
ref: document_chunks.document_id > documents.id
|
|
@@ -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
|