@lobehub/chat 1.119.1 → 1.120.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/.vscode/settings.json +2 -3
- package/CHANGELOG.md +58 -0
- package/changelog/v1.json +17 -0
- package/package.json +5 -6
- package/packages/const/src/auth.ts +0 -36
- package/packages/const/src/index.ts +3 -1
- package/packages/database/src/models/__tests__/aiModel.test.ts +1 -2
- package/packages/database/src/models/__tests__/generationBatch.test.ts +47 -1
- package/packages/database/src/models/aiModel.ts +2 -3
- package/packages/database/src/models/generationBatch.ts +8 -1
- package/packages/database/src/repositories/aiInfra/index.test.ts +1 -1
- package/packages/database/src/repositories/aiInfra/index.ts +4 -4
- package/packages/model-bank/src/aiModels/ai21.ts +1 -1
- package/packages/model-bank/src/aiModels/ai302.ts +1 -1
- package/packages/model-bank/src/aiModels/ai360.ts +1 -1
- package/packages/model-bank/src/aiModels/aihubmix.ts +3 -3
- package/packages/model-bank/src/aiModels/akashchat.ts +1 -1
- package/packages/model-bank/src/aiModels/anthropic.ts +1 -1
- package/packages/model-bank/src/aiModels/azure.ts +1 -1
- package/packages/model-bank/src/aiModels/azureai.ts +1 -1
- package/packages/model-bank/src/aiModels/baichuan.ts +1 -1
- package/packages/model-bank/src/aiModels/bedrock.ts +1 -1
- package/packages/model-bank/src/aiModels/bfl.ts +2 -3
- package/packages/model-bank/src/aiModels/cloudflare.ts +1 -1
- package/packages/model-bank/src/aiModels/cohere.ts +1 -1
- package/packages/model-bank/src/aiModels/deepseek.ts +1 -1
- package/packages/model-bank/src/aiModels/fal.ts +1 -1
- package/packages/model-bank/src/aiModels/fireworksai.ts +1 -1
- package/packages/model-bank/src/aiModels/giteeai.ts +1 -1
- package/packages/model-bank/src/aiModels/github.ts +1 -1
- package/packages/model-bank/src/aiModels/google.ts +6 -7
- package/packages/model-bank/src/aiModels/groq.ts +1 -1
- package/packages/model-bank/src/aiModels/higress.ts +1 -1
- package/packages/model-bank/src/aiModels/huggingface.ts +1 -1
- package/packages/model-bank/src/aiModels/hunyuan.ts +1 -1
- package/packages/model-bank/src/aiModels/index.ts +1 -1
- package/packages/model-bank/src/aiModels/infiniai.ts +1 -1
- package/packages/model-bank/src/aiModels/internlm.ts +1 -1
- package/packages/model-bank/src/aiModels/jina.ts +1 -1
- package/packages/model-bank/src/aiModels/lmstudio.ts +1 -1
- package/packages/model-bank/src/aiModels/lobehub.ts +1 -1
- package/packages/model-bank/src/aiModels/minimax.ts +1 -1
- package/packages/model-bank/src/aiModels/mistral.ts +1 -1
- package/packages/model-bank/src/aiModels/modelscope.ts +1 -1
- package/packages/model-bank/src/aiModels/moonshot.ts +1 -1
- package/packages/model-bank/src/aiModels/novita.ts +1 -1
- package/packages/model-bank/src/aiModels/nvidia.ts +1 -1
- package/packages/model-bank/src/aiModels/ollama.ts +1 -1
- package/packages/model-bank/src/aiModels/openai.ts +1 -1
- package/packages/model-bank/src/aiModels/openrouter.ts +3 -3
- package/packages/model-bank/src/aiModels/perplexity.ts +1 -1
- package/packages/model-bank/src/aiModels/ppio.ts +1 -1
- package/packages/model-bank/src/aiModels/qiniu.ts +1 -1
- package/packages/model-bank/src/aiModels/qwen.ts +4 -2
- package/packages/model-bank/src/aiModels/sambanova.ts +1 -1
- package/packages/model-bank/src/aiModels/search1api.ts +1 -1
- package/packages/model-bank/src/aiModels/sensenova.ts +1 -1
- package/packages/model-bank/src/aiModels/siliconcloud.ts +7 -1
- package/packages/model-bank/src/aiModels/spark.ts +1 -1
- package/packages/model-bank/src/aiModels/stepfun.ts +1 -1
- package/packages/model-bank/src/aiModels/taichu.ts +1 -1
- package/packages/model-bank/src/aiModels/tencentcloud.ts +1 -1
- package/packages/model-bank/src/aiModels/togetherai.ts +1 -1
- package/packages/model-bank/src/aiModels/upstage.ts +1 -1
- package/packages/model-bank/src/aiModels/v0.ts +1 -1
- package/packages/model-bank/src/aiModels/vertexai.ts +3 -3
- package/packages/model-bank/src/aiModels/vllm.ts +1 -1
- package/packages/model-bank/src/aiModels/volcengine.ts +1 -1
- package/packages/model-bank/src/aiModels/wenxin.ts +1 -1
- package/packages/model-bank/src/aiModels/xai.ts +1 -1
- package/packages/model-bank/src/aiModels/xinference.ts +1 -1
- package/packages/model-bank/src/aiModels/zeroone.ts +1 -1
- package/packages/model-bank/src/aiModels/zhipu.ts +1 -1
- package/packages/model-bank/src/index.ts +1 -0
- package/packages/model-bank/src/standard-parameters/index.ts +48 -0
- package/packages/{types/src → model-bank/src/types}/aiModel.ts +12 -1
- package/packages/model-bank/src/types/index.ts +1 -0
- package/packages/model-runtime/package.json +4 -1
- package/packages/model-runtime/src/BaseAI.ts +2 -2
- package/packages/model-runtime/src/ModelRuntime.test.ts +4 -4
- package/packages/model-runtime/src/RouterRuntime/createRuntime.ts +3 -7
- package/packages/model-runtime/src/ai302/index.ts +1 -1
- package/packages/model-runtime/src/aihubmix/index.ts +1 -2
- package/packages/model-runtime/src/anthropic/index.ts +1 -1
- package/packages/model-runtime/src/azureOpenai/index.ts +2 -3
- package/packages/model-runtime/src/azureai/index.ts +2 -3
- package/packages/model-runtime/src/bedrock/index.ts +1 -1
- package/packages/model-runtime/src/bfl/createImage.test.ts +4 -4
- package/packages/model-runtime/src/bfl/createImage.ts +2 -2
- package/packages/model-runtime/src/bfl/index.ts +1 -1
- package/packages/model-runtime/src/cloudflare/index.ts +1 -1
- package/packages/model-runtime/src/const/models.ts +64 -0
- package/packages/model-runtime/src/fal/index.test.ts +2 -3
- package/packages/model-runtime/src/fal/index.ts +1 -1
- package/packages/model-runtime/src/github/index.ts +1 -1
- package/packages/model-runtime/src/google/createImage.test.ts +1 -1
- package/packages/model-runtime/src/google/createImage.ts +53 -25
- package/packages/model-runtime/src/google/index.test.ts +1 -1
- package/packages/model-runtime/src/google/index.ts +4 -3
- package/packages/model-runtime/src/groq/index.ts +1 -1
- package/packages/model-runtime/src/helpers/parseToolCalls.ts +1 -2
- package/packages/model-runtime/src/huggingface/index.ts +1 -1
- package/packages/model-runtime/src/index.ts +3 -1
- package/packages/model-runtime/src/infiniai/index.ts +1 -1
- package/packages/model-runtime/src/ollama/index.test.ts +1 -1
- package/packages/model-runtime/src/ollama/index.ts +2 -3
- package/packages/model-runtime/src/openai/index.ts +16 -8
- package/packages/model-runtime/src/providerTestUtils.ts +1 -2
- package/packages/model-runtime/src/qiniu/index.test.ts +2 -3
- package/packages/model-runtime/src/qwen/index.ts +1 -1
- package/packages/model-runtime/src/siliconcloud/index.ts +2 -2
- package/packages/model-runtime/src/types/chat.ts +2 -22
- package/packages/model-runtime/src/{error.ts → types/error.ts} +29 -0
- package/packages/model-runtime/src/types/index.ts +4 -0
- package/packages/model-runtime/src/types/toolsCalling.ts +48 -0
- package/packages/model-runtime/src/types/type.ts +1 -1
- package/packages/model-runtime/src/types/usage.ts +27 -0
- package/packages/model-runtime/src/utils/anthropicHelpers.test.ts +2 -2
- package/packages/model-runtime/src/utils/anthropicHelpers.ts +1 -1
- package/packages/model-runtime/src/utils/createError.ts +1 -1
- package/packages/model-runtime/src/utils/errorResponse.test.ts +110 -0
- package/packages/model-runtime/src/utils/errorResponse.ts +64 -0
- package/packages/{utils/src → model-runtime/src/utils}/getFallbackModelProperty.ts +1 -1
- package/packages/model-runtime/src/utils/googleErrorParser.test.ts +1 -1
- package/packages/model-runtime/src/utils/googleErrorParser.ts +1 -1
- package/packages/model-runtime/src/utils/handleOpenAIError.ts +1 -1
- package/packages/model-runtime/src/utils/imageToBase64.test.ts +91 -0
- package/packages/model-runtime/src/utils/imageToBase64.ts +62 -0
- package/packages/model-runtime/src/utils/modelParse.test.ts +2 -2
- package/packages/model-runtime/src/utils/modelParse.ts +16 -10
- package/packages/model-runtime/src/utils/openaiCompatibleFactory/createImage.ts +1 -1
- package/packages/model-runtime/src/utils/openaiCompatibleFactory/index.ts +3 -3
- package/packages/model-runtime/src/utils/openaiHelpers.test.ts +2 -2
- package/packages/model-runtime/src/utils/openaiHelpers.ts +3 -4
- package/packages/model-runtime/src/utils/postProcessModelList.ts +2 -2
- package/packages/model-runtime/src/utils/safeParseJSON.test.ts +71 -0
- package/packages/model-runtime/src/utils/safeParseJSON.ts +12 -0
- package/packages/model-runtime/src/utils/streams/bedrock/claude.ts +1 -1
- package/packages/model-runtime/src/utils/streams/bedrock/llama.test.ts +1 -2
- package/packages/model-runtime/src/utils/streams/bedrock/llama.ts +1 -1
- package/packages/model-runtime/src/utils/streams/google-ai.test.ts +1 -1
- package/packages/model-runtime/src/utils/streams/google-ai.ts +1 -1
- package/packages/model-runtime/src/utils/streams/ollama.test.ts +1 -1
- package/packages/model-runtime/src/utils/streams/ollama.ts +2 -3
- package/packages/model-runtime/src/utils/streams/openai/openai.test.ts +1 -2
- package/packages/model-runtime/src/utils/streams/openai/openai.ts +1 -1
- package/packages/model-runtime/src/utils/streams/openai/responsesStream.ts +1 -1
- package/packages/model-runtime/src/utils/streams/protocol.ts +3 -3
- package/packages/model-runtime/src/utils/streams/vertex-ai.test.ts +1 -1
- package/packages/model-runtime/src/utils/streams/vertex-ai.ts +2 -2
- package/packages/model-runtime/src/utils/uuid.ts +7 -0
- package/packages/model-runtime/src/vertexai/index.ts +1 -1
- package/packages/types/src/agent/index.ts +2 -1
- package/packages/types/src/aiProvider.ts +10 -2
- package/packages/types/src/auth.ts +35 -0
- package/packages/types/src/discover/models.ts +1 -1
- package/packages/types/src/discover/providers.ts +1 -1
- package/packages/types/src/index.ts +4 -0
- package/packages/types/src/llm.ts +2 -47
- package/packages/types/src/session/agentSession.ts +3 -3
- package/packages/types/src/session/index.ts +2 -2
- package/packages/types/src/session/sessionGroup.ts +0 -2
- package/packages/types/src/user/settings/general.ts +1 -1
- package/packages/types/src/user/settings/modelProvider.ts +1 -1
- package/packages/utils/src/fetch/fetchSSE.ts +1 -1
- package/packages/utils/src/format.ts +2 -3
- package/packages/utils/src/index.ts +3 -1
- package/packages/utils/src/number.test.ts +1 -2
- package/packages/utils/src/number.ts +1 -2
- package/packages/utils/src/parseModels.test.ts +1 -2
- package/packages/utils/src/parseModels.ts +2 -3
- package/packages/utils/src/pricing.test.ts +1 -2
- package/packages/utils/src/pricing.ts +1 -1
- package/packages/utils/src/server/xor.ts +3 -1
- package/src/app/(backend)/middleware/auth/index.ts +1 -2
- package/src/app/(backend)/webapi/chat/vertexai/route.ts +1 -1
- package/src/app/(backend)/webapi/text-to-image/[provider]/route.ts +1 -2
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +2 -16
- package/src/app/[variants]/(main)/chat/@session/_layout/Desktop/SessionHeader.tsx +1 -3
- package/src/app/[variants]/(main)/chat/@session/_layout/Mobile/SessionHeader.tsx +1 -3
- package/src/app/[variants]/(main)/discover/(list)/model/features/List/ModelTypeIcon.tsx +1 -2
- package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +1 -1
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/hooks/useAutoDimensions.ts +4 -3
- package/src/app/[variants]/(main)/settings/hooks/useCategory.tsx +3 -21
- package/src/app/[variants]/(main)/settings/provider/features/ModelList/CreateNewModelModal/Form.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelItem.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/ListItem.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/ModelList/SortModelModal/index.tsx +1 -1
- package/src/components/ModelSelect/index.tsx +1 -1
- package/src/config/featureFlags/schema.test.ts +1 -2
- package/src/config/featureFlags/schema.ts +0 -6
- package/src/config/featureFlags/utils/parser.test.ts +7 -7
- package/src/database/_deprecated/core/index.ts +0 -1
- package/src/database/_deprecated/core/migrations/migrateSettingsToUser/type.ts +2 -5
- package/src/database/_deprecated/core/model.ts +4 -38
- package/src/database/_deprecated/models/message.ts +1 -1
- package/src/features/Conversation/Extras/Usage/UsageDetail/ModelCard.tsx +1 -1
- package/src/features/Conversation/Extras/Usage/UsageDetail/pricing.ts +3 -4
- package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.test.ts +1 -1
- package/src/features/Conversation/Extras/Usage/UsageDetail/tokens.ts +3 -2
- package/src/layout/GlobalProvider/StoreInitialization.tsx +0 -3
- package/src/libs/trpc/async/context.ts +2 -1
- package/src/libs/trpc/edge/context.ts +2 -6
- package/src/libs/trpc/lambda/context.ts +1 -1
- package/src/migrations/FromV5ToV6/types/v5.ts +2 -2
- package/src/migrations/FromV5ToV6/types/v6.ts +2 -1
- package/src/server/globalConfig/genServerAiProviderConfig.ts +3 -3
- package/src/server/modules/ModelRuntime/index.test.ts +1 -1
- package/src/server/modules/ModelRuntime/index.ts +1 -1
- package/src/server/routers/async/caller.ts +2 -1
- package/src/server/routers/async/image.ts +2 -2
- package/src/server/routers/lambda/aiModel.ts +1 -1
- package/src/server/services/chunk/index.ts +2 -1
- package/src/server/services/generation/index.ts +2 -2
- package/src/services/_auth.ts +2 -1
- package/src/services/aiModel/server.test.ts +1 -1
- package/src/services/aiModel/type.ts +1 -1
- package/src/services/chat.ts +1 -1
- package/src/services/upload.ts +3 -3
- package/src/store/agent/slices/chat/action.ts +1 -1
- package/src/store/aiInfra/slices/aiModel/action.ts +6 -6
- package/src/store/aiInfra/slices/aiModel/initialState.ts +1 -1
- package/src/store/aiInfra/slices/aiModel/selectors.test.ts +1 -1
- package/src/store/aiInfra/slices/aiModel/selectors.ts +2 -1
- package/src/store/aiInfra/slices/aiProvider/__tests__/action.test.ts +7 -7
- package/src/store/aiInfra/slices/aiProvider/action.ts +8 -8
- package/src/store/aiInfra/slices/aiProvider/initialState.ts +2 -1
- package/src/store/electron/actions/app.ts +1 -1
- package/src/store/image/slices/generationConfig/action.test.ts +1 -1
- package/src/store/image/slices/generationConfig/action.ts +1 -1
- package/src/store/image/slices/generationConfig/hooks.test.ts +1 -1
- package/src/store/image/slices/generationConfig/hooks.ts +6 -3
- package/src/store/image/slices/generationConfig/selectors.test.ts +1 -1
- package/src/store/serverConfig/selectors.test.ts +0 -1
- package/src/store/user/initialState.ts +1 -4
- package/src/store/user/selectors.ts +0 -1
- package/src/store/user/slices/auth/action.ts +1 -1
- package/src/store/user/slices/auth/selectors.ts +3 -4
- package/src/store/user/slices/modelList/action.ts +8 -7
- package/src/store/user/slices/modelList/selectors/modelProvider.ts +8 -5
- package/src/store/user/slices/preference/selectors.ts +3 -2
- package/src/store/user/slices/settings/selectors/settings.ts +1 -2
- package/src/store/user/store.ts +1 -4
- package/docs/self-hosting/advanced/webrtc.mdx +0 -86
- package/docs/self-hosting/advanced/webrtc.zh-CN.mdx +0 -80
- package/packages/const/src/image.ts +0 -51
- package/src/app/[variants]/(main)/settings/sync/features/Alert.tsx +0 -53
- package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/Card.tsx +0 -42
- package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/DeviceName.tsx +0 -62
- package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/SystemIcon.tsx +0 -31
- package/src/app/[variants]/(main)/settings/sync/features/DeviceInfo/index.tsx +0 -103
- package/src/app/[variants]/(main)/settings/sync/features/WebRTC/ChannelNameInput.tsx +0 -45
- package/src/app/[variants]/(main)/settings/sync/features/WebRTC/SyncSwitch/index.css +0 -238
- package/src/app/[variants]/(main)/settings/sync/features/WebRTC/SyncSwitch/index.tsx +0 -79
- package/src/app/[variants]/(main)/settings/sync/features/WebRTC/generateRandomRoomName.ts +0 -4
- package/src/app/[variants]/(main)/settings/sync/features/WebRTC/index.tsx +0 -103
- package/src/app/[variants]/(main)/settings/sync/index.tsx +0 -17
- package/src/app/[variants]/(main)/settings/sync/page.tsx +0 -29
- package/src/database/_deprecated/core/sync.ts +0 -321
- package/src/features/SyncStatusInspector/DisableSync.tsx +0 -79
- package/src/features/SyncStatusInspector/EnableSync.tsx +0 -132
- package/src/features/SyncStatusInspector/EnableTag.tsx +0 -66
- package/src/features/SyncStatusInspector/index.tsx +0 -27
- package/src/hooks/useSyncData.ts +0 -50
- package/src/services/__tests__/sync.test.ts +0 -56
- package/src/services/sync.ts +0 -19
- package/src/store/user/slices/sync/action.test.ts +0 -164
- package/src/store/user/slices/sync/action.ts +0 -101
- package/src/store/user/slices/sync/initialState.ts +0 -13
- package/src/store/user/slices/sync/selectors.ts +0 -20
- /package/packages/{utils/src → model-runtime/src/utils}/getFallbackModelProperty.test.ts +0 -0
package/.vscode/settings.json
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
// make stylelint work with tsx antd-style css template string
|
35
35
|
"typescriptreact"
|
36
36
|
],
|
37
|
-
"vitest.maximumConfigs":
|
37
|
+
"vitest.maximumConfigs": 20,
|
38
38
|
"workbench.editor.customLabels.patterns": {
|
39
39
|
"**/app/**/[[]*[]]/[[]*[]]/page.tsx": "${dirname(2)}/${dirname(1)}/${dirname} • page component",
|
40
40
|
"**/app/**/[[]*[]]/page.tsx": "${dirname(1)}/${dirname} • page component",
|
@@ -81,8 +81,7 @@
|
|
81
81
|
"**/src/store/*/slices/*/reducer.ts": "${dirname(2)}/${dirname} • reducer",
|
82
82
|
|
83
83
|
"**/src/config/modelProviders/*.ts": "${filename} • provider",
|
84
|
-
"**/src/
|
85
|
-
"**/src/config/paramsSchemas/*/*.json": "${dirname(1)}/${filename} • params",
|
84
|
+
"**/packages/model-bank/src/aiModels/aiModels/*.ts": "${filename} • model",
|
86
85
|
"**/packages/model-runtime/src/*/index.ts": "${dirname} • runtime",
|
87
86
|
|
88
87
|
"**/src/server/services/*/index.ts": "${dirname} • server/service",
|
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,64 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
## [Version 1.120.0](https://github.com/lobehub/lobe-chat/compare/v1.119.2...v1.120.0)
|
6
|
+
|
7
|
+
<sup>Released on **2025-08-30**</sup>
|
8
|
+
|
9
|
+
#### ♻ Code Refactoring
|
10
|
+
|
11
|
+
- **misc**: Remove webrtc sync feature flag.
|
12
|
+
|
13
|
+
#### ✨ Features
|
14
|
+
|
15
|
+
- **misc**: Rename Gemini 2.5 flash image to Nano Banana.
|
16
|
+
|
17
|
+
<br/>
|
18
|
+
|
19
|
+
<details>
|
20
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
21
|
+
|
22
|
+
#### Code refactoring
|
23
|
+
|
24
|
+
- **misc**: Remove webrtc sync feature flag, closes [#9002](https://github.com/lobehub/lobe-chat/issues/9002) ([0924d98](https://github.com/lobehub/lobe-chat/commit/0924d98))
|
25
|
+
|
26
|
+
#### What's improved
|
27
|
+
|
28
|
+
- **misc**: Rename Gemini 2.5 flash image to Nano Banana, closes [#9004](https://github.com/lobehub/lobe-chat/issues/9004) ([dac5a6f](https://github.com/lobehub/lobe-chat/commit/dac5a6f))
|
29
|
+
|
30
|
+
</details>
|
31
|
+
|
32
|
+
<div align="right">
|
33
|
+
|
34
|
+
[](#readme-top)
|
35
|
+
|
36
|
+
</div>
|
37
|
+
|
38
|
+
### [Version 1.119.2](https://github.com/lobehub/lobe-chat/compare/v1.119.1...v1.119.2)
|
39
|
+
|
40
|
+
<sup>Released on **2025-08-30**</sup>
|
41
|
+
|
42
|
+
#### ♻ Code Refactoring
|
43
|
+
|
44
|
+
- **model-runtime**: Refactor model-runtime dependencies and clean code.
|
45
|
+
|
46
|
+
<br/>
|
47
|
+
|
48
|
+
<details>
|
49
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
50
|
+
|
51
|
+
#### Code refactoring
|
52
|
+
|
53
|
+
- **model-runtime**: Refactor model-runtime dependencies and clean code, closes [#8997](https://github.com/lobehub/lobe-chat/issues/8997) ([9f7677d](https://github.com/lobehub/lobe-chat/commit/9f7677d))
|
54
|
+
|
55
|
+
</details>
|
56
|
+
|
57
|
+
<div align="right">
|
58
|
+
|
59
|
+
[](#readme-top)
|
60
|
+
|
61
|
+
</div>
|
62
|
+
|
5
63
|
### [Version 1.119.1](https://github.com/lobehub/lobe-chat/compare/v1.119.0...v1.119.1)
|
6
64
|
|
7
65
|
<sup>Released on **2025-08-30**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,21 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"improvements": [
|
5
|
+
"Remove webrtc sync feature flag."
|
6
|
+
],
|
7
|
+
"features": [
|
8
|
+
"Rename Gemini 2.5 flash image to Nano Banana."
|
9
|
+
]
|
10
|
+
},
|
11
|
+
"date": "2025-08-30",
|
12
|
+
"version": "1.120.0"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"children": {},
|
16
|
+
"date": "2025-08-30",
|
17
|
+
"version": "1.119.2"
|
18
|
+
},
|
2
19
|
{
|
3
20
|
"children": {
|
4
21
|
"fixes": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.120.0",
|
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",
|
@@ -54,7 +54,9 @@
|
|
54
54
|
"docs:seo": "lobe-seo && npm run lint:mdx",
|
55
55
|
"i18n": "npm run workflow:i18n && lobe-i18n && prettier -c --write \"locales/**\"",
|
56
56
|
"lint": "npm run lint:ts && npm run lint:style && npm run type-check && npm run lint:circular",
|
57
|
-
"lint:circular": "
|
57
|
+
"lint:circular": "npm run lint:circular:main && npm run lint:circular:packages",
|
58
|
+
"lint:circular:main": "dpdm src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
|
59
|
+
"lint:circular:packages": "dpdm packages/**/src/**/*.ts --no-warning --no-tree --exit-code circular:1 --no-progress -T true --skip-dynamic-imports circular",
|
58
60
|
"lint:md": "remark . --silent --output",
|
59
61
|
"lint:mdx": "npm run workflow:mdx && remark \"docs/**/*.mdx\" -r ./.remarkrc.mdx.js --silent --output && eslint \"docs/**/*.mdx\" --quiet --fix",
|
60
62
|
"lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
|
@@ -273,10 +275,7 @@
|
|
273
275
|
"use-merge-value": "^1.2.0",
|
274
276
|
"uuid": "^11.1.0",
|
275
277
|
"ws": "^8.18.3",
|
276
|
-
"y-protocols": "^1.0.6",
|
277
|
-
"y-webrtc": "^10.3.0",
|
278
278
|
"yaml": "^2.8.1",
|
279
|
-
"yjs": "^13.6.27",
|
280
279
|
"zod": "^3.25.76",
|
281
280
|
"zustand": "5.0.4",
|
282
281
|
"zustand-utils": "^2.1.0"
|
@@ -328,7 +327,7 @@
|
|
328
327
|
"crypto-js": "^4.2.0",
|
329
328
|
"dbdocs": "^0.16.0",
|
330
329
|
"dotenv": "^17.0.0",
|
331
|
-
"dpdm-fast": "1.0.
|
330
|
+
"dpdm-fast": "^1.0.13",
|
332
331
|
"drizzle-dbml-generator": "^0.10.0",
|
333
332
|
"drizzle-kit": "^0.31.4",
|
334
333
|
"eslint": "^8.57.1",
|
@@ -10,39 +10,3 @@ export const LOBE_CHAT_OIDC_AUTH_HEADER = 'Oidc-Auth';
|
|
10
10
|
export const OAUTH_AUTHORIZED = 'X-oauth-authorized';
|
11
11
|
|
12
12
|
export const SECRET_XOR_KEY = 'LobeHub · LobeHub';
|
13
|
-
|
14
|
-
/* eslint-disable typescript-sort-keys/interface */
|
15
|
-
export interface ClientSecretPayload {
|
16
|
-
/**
|
17
|
-
* password
|
18
|
-
*/
|
19
|
-
accessCode?: string;
|
20
|
-
/**
|
21
|
-
* Represents the user's API key
|
22
|
-
*
|
23
|
-
* If provider need multi keys like bedrock,
|
24
|
-
* this will be used as the checker whether to use frontend key
|
25
|
-
*/
|
26
|
-
apiKey?: string;
|
27
|
-
/**
|
28
|
-
* Represents the endpoint of provider
|
29
|
-
*/
|
30
|
-
baseURL?: string;
|
31
|
-
|
32
|
-
azureApiVersion?: string;
|
33
|
-
|
34
|
-
awsAccessKeyId?: string;
|
35
|
-
awsRegion?: string;
|
36
|
-
awsSecretAccessKey?: string;
|
37
|
-
awsSessionToken?: string;
|
38
|
-
|
39
|
-
cloudflareBaseURLOrAccountID?: string;
|
40
|
-
|
41
|
-
/**
|
42
|
-
* user id
|
43
|
-
* in client db mode it's a uuid
|
44
|
-
* in server db mode it's a user id
|
45
|
-
*/
|
46
|
-
userId?: string;
|
47
|
-
}
|
48
|
-
/* eslint-enable */
|
@@ -1,9 +1,8 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { eq } from 'drizzle-orm';
|
3
|
+
import { AiProviderModelListItem } from 'model-bank';
|
3
4
|
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
|
4
5
|
|
5
|
-
import { AiProviderModelListItem } from '@/types/aiModel';
|
6
|
-
|
7
6
|
import { AiModelSelectItem, NewAiModelItem, aiModels, users } from '../../schemas';
|
8
7
|
import { LobeChatDatabase } from '../../type';
|
9
8
|
import { AiModelModel } from '../aiModel';
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { eq } from 'drizzle-orm';
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import {
|
5
|
+
import { AsyncTaskStatus } from '@/types/asyncTask';
|
6
6
|
import { GenerationConfig } from '@/types/generation';
|
7
7
|
|
8
8
|
import {
|
@@ -12,6 +12,7 @@ import {
|
|
12
12
|
generations,
|
13
13
|
users,
|
14
14
|
} from '../../schemas';
|
15
|
+
import { LobeChatDatabase } from '../../type';
|
15
16
|
import { GenerationBatchModel } from '../generationBatch';
|
16
17
|
import { getTestDB } from './_util';
|
17
18
|
|
@@ -367,6 +368,51 @@ describe('GenerationBatchModel', () => {
|
|
367
368
|
});
|
368
369
|
});
|
369
370
|
|
371
|
+
it('should transform single config imageUrl through FileService', async () => {
|
372
|
+
const [createdBatch] = await serverDB
|
373
|
+
.insert(generationBatches)
|
374
|
+
.values({
|
375
|
+
...testBatch,
|
376
|
+
userId,
|
377
|
+
config: { imageUrl: 'single-image.jpg', prompt: 'test prompt' },
|
378
|
+
})
|
379
|
+
.returning();
|
380
|
+
|
381
|
+
const results = await generationBatchModel.queryGenerationBatchesByTopicIdWithGenerations(
|
382
|
+
testTopic.id,
|
383
|
+
);
|
384
|
+
|
385
|
+
expect(results[0].config).toEqual({
|
386
|
+
imageUrl: 'https://example.com/single-image.jpg',
|
387
|
+
prompt: 'test prompt',
|
388
|
+
});
|
389
|
+
});
|
390
|
+
|
391
|
+
it('should transform both imageUrl and imageUrls when both are present', async () => {
|
392
|
+
const [createdBatch] = await serverDB
|
393
|
+
.insert(generationBatches)
|
394
|
+
.values({
|
395
|
+
...testBatch,
|
396
|
+
userId,
|
397
|
+
config: {
|
398
|
+
imageUrl: 'single-image.jpg',
|
399
|
+
imageUrls: ['url1.jpg', 'url2.jpg'],
|
400
|
+
prompt: 'test prompt',
|
401
|
+
},
|
402
|
+
})
|
403
|
+
.returning();
|
404
|
+
|
405
|
+
const results = await generationBatchModel.queryGenerationBatchesByTopicIdWithGenerations(
|
406
|
+
testTopic.id,
|
407
|
+
);
|
408
|
+
|
409
|
+
expect(results[0].config).toEqual({
|
410
|
+
imageUrl: 'https://example.com/single-image.jpg',
|
411
|
+
imageUrls: ['https://example.com/url1.jpg', 'https://example.com/url2.jpg'],
|
412
|
+
prompt: 'test prompt',
|
413
|
+
});
|
414
|
+
});
|
415
|
+
|
370
416
|
it('should handle config without imageUrls', async () => {
|
371
417
|
const [createdBatch] = await serverDB
|
372
418
|
.insert(generationBatches)
|
@@ -1,15 +1,14 @@
|
|
1
1
|
import { and, asc, desc, eq, inArray } from 'drizzle-orm';
|
2
|
-
|
3
|
-
import { LobeChatDatabase } from '../type';
|
4
2
|
import {
|
5
3
|
AiModelSortMap,
|
6
4
|
AiModelSourceEnum,
|
7
5
|
AiProviderModelListItem,
|
8
6
|
EnabledAiModel,
|
9
7
|
ToggleAiModelEnableParams,
|
10
|
-
} from '
|
8
|
+
} from 'model-bank';
|
11
9
|
|
12
10
|
import { AiModelSelectItem, NewAiModelItem, aiModels } from '../schemas';
|
11
|
+
import { LobeChatDatabase } from '../type';
|
13
12
|
|
14
13
|
export class AiModelModel {
|
15
14
|
private userId: string;
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import debug from 'debug';
|
2
2
|
import { and, eq } from 'drizzle-orm';
|
3
3
|
|
4
|
-
import { LobeChatDatabase } from '../type';
|
5
4
|
import { FileService } from '@/server/services/file';
|
6
5
|
import { Generation, GenerationAsset, GenerationBatch, GenerationConfig } from '@/types/generation';
|
7
6
|
|
@@ -11,6 +10,7 @@ import {
|
|
11
10
|
NewGenerationBatch,
|
12
11
|
generationBatches,
|
13
12
|
} from '../schemas/generation';
|
13
|
+
import { LobeChatDatabase } from '../type';
|
14
14
|
import { GenerationModel } from './generation';
|
15
15
|
|
16
16
|
const log = debug('lobe-image:generation-batch-model');
|
@@ -121,6 +121,13 @@ export class GenerationBatchModel {
|
|
121
121
|
// Transform config
|
122
122
|
(async () => {
|
123
123
|
const config = batch.config as GenerationConfig;
|
124
|
+
|
125
|
+
// Handle single imageUrl
|
126
|
+
if (config.imageUrl) {
|
127
|
+
config.imageUrl = await this.fileService.getFullFileUrl(config.imageUrl);
|
128
|
+
}
|
129
|
+
|
130
|
+
// Handle imageUrls array
|
124
131
|
if (Array.isArray(config.imageUrls)) {
|
125
132
|
config.imageUrls = await Promise.all(
|
126
133
|
config.imageUrls.map((url) => this.fileService.getFullFileUrl(url)),
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import { AiProviderModelListItem, EnabledAiModel } from 'model-bank';
|
1
2
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
2
3
|
|
3
4
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
4
5
|
import { clientDB, initializeDB } from '@/database/client/db';
|
5
|
-
import { AiProviderModelListItem, EnabledAiModel } from '@/types/aiModel';
|
6
6
|
import {
|
7
7
|
AiProviderDetailItem,
|
8
8
|
AiProviderListItem,
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { isEmpty } from 'lodash-es';
|
2
|
-
import pMap from 'p-map';
|
3
|
-
|
4
|
-
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
5
2
|
import {
|
6
3
|
AIChatModelCard,
|
7
4
|
AiModelSourceEnum,
|
8
5
|
AiProviderModelListItem,
|
9
6
|
EnabledAiModel,
|
10
|
-
} from '
|
7
|
+
} from 'model-bank';
|
8
|
+
import pMap from 'p-map';
|
9
|
+
|
10
|
+
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
11
11
|
import {
|
12
12
|
AiProviderDetailItem,
|
13
13
|
AiProviderListItem,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AIChatModelCard } from '
|
1
|
+
import { AIChatModelCard } from '../types/aiModel';
|
2
2
|
|
3
3
|
const aihubmixModels: AIChatModelCard[] = [
|
4
4
|
{
|
@@ -700,7 +700,7 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
700
700
|
},
|
701
701
|
contextWindowTokens: 32_768 + 8192,
|
702
702
|
description: 'Gemini 2.5 Flash 实验模型,支持图像生成',
|
703
|
-
displayName: '
|
703
|
+
displayName: 'Nano Banana',
|
704
704
|
id: 'gemini-2.5-flash-image-preview',
|
705
705
|
maxOutput: 8192,
|
706
706
|
pricing: {
|
@@ -827,4 +827,4 @@ const aihubmixModels: AIChatModelCard[] = [
|
|
827
827
|
},
|
828
828
|
];
|
829
829
|
|
830
|
-
export default aihubmixModels;
|
830
|
+
export default aihubmixModels;
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { PRESET_ASPECT_RATIOS } from '
|
2
|
-
import {
|
3
|
-
import { AIImageModelCard } from '@/types/aiModel';
|
1
|
+
import { ModelParamsSchema, PRESET_ASPECT_RATIOS } from '../standard-parameters';
|
2
|
+
import { AIImageModelCard } from '../types';
|
4
3
|
|
5
4
|
// https://docs.bfl.ai/api-reference/tasks/edit-or-create-an-image-with-flux-kontext-pro
|
6
5
|
// official support 21:9 ~ 9:21 (ratio 0.43 ~ 2.33)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ModelParamsSchema } from '../standard-parameters';
|
2
|
-
import { AIImageModelCard } from '
|
2
|
+
import { AIImageModelCard } from '../types/aiModel';
|
3
3
|
|
4
4
|
export const fluxSchnellParamsSchema: ModelParamsSchema = {
|
5
5
|
height: { default: 1024, max: 1536, min: 512, step: 1 },
|
@@ -1,6 +1,5 @@
|
|
1
|
-
import { CHAT_MODEL_IMAGE_GENERATION_PARAMS } from '
|
2
|
-
import {
|
3
|
-
import { AIChatModelCard, AIImageModelCard } from '@/types/aiModel';
|
1
|
+
import { CHAT_MODEL_IMAGE_GENERATION_PARAMS, ModelParamsSchema } from '../standard-parameters';
|
2
|
+
import { AIChatModelCard, AIImageModelCard } from '../types';
|
4
3
|
|
5
4
|
const googleChatModels: AIChatModelCard[] = [
|
6
5
|
{
|
@@ -197,8 +196,8 @@ const googleChatModels: AIChatModelCard[] = [
|
|
197
196
|
},
|
198
197
|
contextWindowTokens: 32_768 + 8192,
|
199
198
|
description:
|
200
|
-
'
|
201
|
-
displayName: '
|
199
|
+
'Nano Banana 是 Google 最新、最快、最高效的原生多模态模型,它允许您通过对话生成和编辑图像。',
|
200
|
+
displayName: 'Nano Banana',
|
202
201
|
enabled: true,
|
203
202
|
id: 'gemini-2.5-flash-image-preview',
|
204
203
|
maxOutput: 8192,
|
@@ -611,12 +610,12 @@ const imagenBaseParameters: ModelParamsSchema = {
|
|
611
610
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
612
611
|
const googleImageModels: AIImageModelCard[] = [
|
613
612
|
{
|
614
|
-
displayName: '
|
613
|
+
displayName: 'Nano Banana',
|
615
614
|
id: 'gemini-2.5-flash-image-preview:image',
|
616
615
|
enabled: true,
|
617
616
|
type: 'image',
|
618
617
|
description:
|
619
|
-
'
|
618
|
+
'Nano Banana 是 Google 最新、最快、最高效的原生多模态模型,它允许您通过对话生成和编辑图像。',
|
620
619
|
releasedAt: '2025-08-26',
|
621
620
|
parameters: CHAT_MODEL_IMAGE_GENERATION_PARAMS,
|
622
621
|
pricing: {
|