@lobehub/chat 0.146.2 → 0.147.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/.env.example +3 -5
- package/.github/workflows/issue-close-require.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/test.yml +3 -1
- package/.i18nrc.js +13 -8
- package/.seorc.cjs +9 -0
- package/CHANGELOG.md +73 -0
- package/README.md +25 -25
- package/README.zh-CN.md +25 -25
- package/contributing/Home.md +1 -1
- package/docs/self-hosting/advanced/analytics.mdx +12 -0
- package/docs/self-hosting/advanced/analytics.zh-CN.mdx +10 -0
- package/docs/self-hosting/advanced/authentication.mdx +19 -0
- package/docs/self-hosting/advanced/authentication.zh-CN.mdx +15 -0
- package/docs/self-hosting/advanced/sso-providers/auth0.mdx +19 -2
- package/docs/self-hosting/advanced/sso-providers/auth0.zh-CN.mdx +15 -2
- package/docs/self-hosting/advanced/sso-providers/authentik.mdx +18 -3
- package/docs/self-hosting/advanced/sso-providers/authentik.zh-CN.mdx +14 -2
- package/docs/self-hosting/advanced/sso-providers/github.mdx +13 -0
- package/docs/self-hosting/advanced/sso-providers/github.zh-CN.mdx +13 -3
- package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.mdx +18 -2
- package/docs/self-hosting/advanced/sso-providers/microsoft-entra-id.zh-CN.mdx +15 -2
- package/docs/self-hosting/advanced/sso-providers/zitadel.mdx +17 -2
- package/docs/self-hosting/advanced/sso-providers/zitadel.zh-CN.mdx +14 -2
- package/docs/self-hosting/advanced/upstream-sync.mdx +13 -0
- package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +10 -0
- package/docs/self-hosting/environment-variables/analytics.mdx +15 -0
- package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +13 -0
- package/docs/self-hosting/environment-variables/auth.mdx +14 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +15 -1
- package/docs/self-hosting/environment-variables/basic.mdx +15 -0
- package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +11 -0
- package/docs/self-hosting/environment-variables/model-provider.mdx +26 -0
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +10 -0
- package/docs/self-hosting/environment-variables.mdx +13 -2
- package/docs/self-hosting/environment-variables.zh-CN.mdx +9 -0
- package/docs/self-hosting/examples/azure-openai.mdx +12 -0
- package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +12 -0
- package/docs/self-hosting/examples/ollama.mdx +13 -0
- package/docs/self-hosting/examples/ollama.zh-CN.mdx +11 -0
- package/docs/self-hosting/faq/no-v1-suffix.mdx +12 -0
- package/docs/self-hosting/faq/no-v1-suffix.zh-CN.mdx +9 -0
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.mdx +14 -0
- package/docs/self-hosting/faq/proxy-with-unable-to-verify-leaf-signature.zh-CN.mdx +11 -0
- package/docs/self-hosting/platform/docker-compose.mdx +21 -5
- package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +18 -5
- package/docs/self-hosting/platform/docker.mdx +26 -8
- package/docs/self-hosting/platform/docker.zh-CN.mdx +27 -9
- package/docs/self-hosting/platform/netlify.mdx +18 -2
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +14 -1
- package/docs/self-hosting/platform/railway.mdx +12 -0
- package/docs/self-hosting/platform/railway.zh-CN.mdx +11 -0
- package/docs/self-hosting/platform/repocloud.mdx +12 -0
- package/docs/self-hosting/platform/repocloud.zh-CN.mdx +10 -0
- package/docs/self-hosting/platform/sealos.mdx +11 -0
- package/docs/self-hosting/platform/sealos.zh-CN.mdx +10 -0
- package/docs/self-hosting/platform/vercel.mdx +12 -0
- package/docs/self-hosting/platform/vercel.zh-CN.mdx +11 -0
- package/docs/self-hosting/platform/zeabur.mdx +11 -0
- package/docs/self-hosting/platform/zeabur.zh-CN.mdx +10 -0
- package/docs/self-hosting/start.mdx +12 -0
- package/docs/self-hosting/start.zh-CN.mdx +13 -0
- package/docs/usage/agents/concepts.mdx +13 -0
- package/docs/usage/agents/concepts.zh-CN.mdx +10 -0
- package/docs/usage/agents/custom-agent.mdx +16 -2
- package/docs/usage/agents/custom-agent.zh-CN.mdx +14 -2
- package/docs/usage/agents/model.mdx +11 -2
- package/docs/usage/agents/model.zh-CN.mdx +12 -0
- package/docs/usage/agents/prompt.mdx +15 -0
- package/docs/usage/agents/prompt.zh-CN.mdx +10 -0
- package/docs/usage/agents/topics.mdx +13 -0
- package/docs/usage/agents/topics.zh-CN.mdx +11 -0
- package/docs/usage/features/agent-market.mdx +11 -1
- package/docs/usage/features/agent-market.zh-CN.mdx +13 -0
- package/docs/usage/features/local-llm.mdx +12 -2
- package/docs/usage/features/local-llm.zh-CN.mdx +3 -3
- package/docs/usage/features/mobile.mdx +10 -1
- package/docs/usage/features/mobile.zh-CN.mdx +11 -0
- package/docs/usage/features/more.mdx +13 -0
- package/docs/usage/features/more.zh-CN.mdx +10 -0
- package/docs/usage/features/multi-ai-providers.mdx +14 -1
- package/docs/usage/features/multi-ai-providers.zh-CN.mdx +16 -0
- package/docs/usage/features/plugin-system.mdx +12 -1
- package/docs/usage/features/plugin-system.zh-CN.mdx +9 -0
- package/docs/usage/features/pwa.mdx +11 -1
- package/docs/usage/features/pwa.zh-CN.mdx +13 -0
- package/docs/usage/features/text-to-image.mdx +11 -1
- package/docs/usage/features/text-to-image.zh-CN.mdx +13 -0
- package/docs/usage/features/theme.mdx +12 -1
- package/docs/usage/features/theme.zh-CN.mdx +11 -0
- package/docs/usage/features/tts.mdx +14 -1
- package/docs/usage/features/tts.zh-CN.mdx +12 -0
- package/docs/usage/features/vision.mdx +11 -1
- package/docs/usage/features/vision.zh-CN.mdx +10 -0
- package/docs/usage/plugins/basic-usage.mdx +12 -0
- package/docs/usage/plugins/basic-usage.zh-CN.mdx +10 -0
- package/docs/usage/plugins/custom-plugin.mdx +12 -0
- package/docs/usage/plugins/custom-plugin.zh-CN.mdx +10 -0
- package/docs/usage/plugins/development.mdx +18 -0
- package/docs/usage/plugins/development.zh-CN.mdx +12 -0
- package/docs/usage/plugins/store.mdx +12 -0
- package/docs/usage/plugins/store.zh-CN.mdx +9 -0
- package/docs/usage/providers/groq.mdx +14 -2
- package/docs/usage/providers/groq.zh-CN.mdx +12 -2
- package/docs/usage/providers/ollama/gemma.mdx +13 -3
- package/docs/usage/providers/ollama/gemma.zh-CN.mdx +12 -3
- package/docs/usage/providers/ollama/qwen.mdx +12 -4
- package/docs/usage/providers/ollama/qwen.zh-CN.mdx +10 -3
- package/docs/usage/providers/ollama.mdx +19 -9
- package/docs/usage/providers/ollama.zh-CN.mdx +20 -9
- package/docs/usage/start.mdx +13 -2
- package/docs/usage/start.zh-CN.mdx +11 -2
- package/locales/ar/common.json +0 -26
- package/locales/ar/components.json +15 -0
- package/locales/ar/error.json +1 -52
- package/locales/ar/modelProvider.json +226 -0
- package/locales/ar/setting.json +48 -199
- package/locales/bg-BG/common.json +0 -26
- package/locales/bg-BG/components.json +15 -0
- package/locales/bg-BG/error.json +1 -52
- package/locales/bg-BG/modelProvider.json +226 -0
- package/locales/bg-BG/setting.json +48 -199
- package/locales/de-DE/common.json +0 -26
- package/locales/de-DE/components.json +15 -0
- package/locales/de-DE/error.json +1 -52
- package/locales/de-DE/modelProvider.json +226 -0
- package/locales/de-DE/setting.json +48 -199
- package/locales/en-US/common.json +0 -26
- package/locales/en-US/components.json +15 -0
- package/locales/en-US/error.json +1 -52
- package/locales/en-US/modelProvider.json +226 -0
- package/locales/en-US/setting.json +48 -199
- package/locales/es-ES/common.json +0 -26
- package/locales/es-ES/components.json +15 -0
- package/locales/es-ES/error.json +1 -52
- package/locales/es-ES/modelProvider.json +226 -0
- package/locales/es-ES/setting.json +48 -199
- package/locales/fr-FR/common.json +0 -26
- package/locales/fr-FR/components.json +15 -0
- package/locales/fr-FR/error.json +1 -52
- package/locales/fr-FR/modelProvider.json +226 -0
- package/locales/fr-FR/setting.json +48 -199
- package/locales/it-IT/common.json +0 -26
- package/locales/it-IT/components.json +15 -0
- package/locales/it-IT/error.json +1 -52
- package/locales/it-IT/modelProvider.json +226 -0
- package/locales/it-IT/setting.json +59 -210
- package/locales/ja-JP/common.json +0 -26
- package/locales/ja-JP/components.json +15 -0
- package/locales/ja-JP/error.json +1 -52
- package/locales/ja-JP/modelProvider.json +226 -0
- package/locales/ja-JP/setting.json +59 -210
- package/locales/ko-KR/common.json +0 -26
- package/locales/ko-KR/components.json +15 -0
- package/locales/ko-KR/error.json +1 -52
- package/locales/ko-KR/modelProvider.json +226 -0
- package/locales/ko-KR/setting.json +48 -199
- package/locales/nl-NL/common.json +0 -26
- package/locales/nl-NL/components.json +15 -0
- package/locales/nl-NL/error.json +4 -55
- package/locales/nl-NL/modelProvider.json +226 -0
- package/locales/nl-NL/setting.json +49 -200
- package/locales/pl-PL/common.json +0 -26
- package/locales/pl-PL/components.json +15 -0
- package/locales/pl-PL/error.json +1 -52
- package/locales/pl-PL/modelProvider.json +226 -0
- package/locales/pl-PL/setting.json +48 -199
- package/locales/pt-BR/common.json +0 -26
- package/locales/pt-BR/components.json +15 -0
- package/locales/pt-BR/error.json +1 -52
- package/locales/pt-BR/modelProvider.json +226 -0
- package/locales/pt-BR/setting.json +48 -199
- package/locales/ru-RU/common.json +0 -26
- package/locales/ru-RU/components.json +15 -0
- package/locales/ru-RU/error.json +1 -52
- package/locales/ru-RU/modelProvider.json +226 -0
- package/locales/ru-RU/setting.json +48 -199
- package/locales/tr-TR/common.json +0 -26
- package/locales/tr-TR/components.json +15 -0
- package/locales/tr-TR/error.json +1 -52
- package/locales/tr-TR/modelProvider.json +226 -0
- package/locales/tr-TR/setting.json +48 -199
- package/locales/vi-VN/common.json +0 -26
- package/locales/vi-VN/components.json +15 -0
- package/locales/vi-VN/error.json +1 -52
- package/locales/vi-VN/modelProvider.json +226 -0
- package/locales/vi-VN/setting.json +48 -199
- package/locales/zh-CN/common.json +0 -26
- package/locales/zh-CN/components.json +15 -0
- package/locales/zh-CN/error.json +2 -53
- package/locales/zh-CN/modelProvider.json +226 -0
- package/locales/zh-CN/setting.json +48 -199
- package/locales/zh-TW/common.json +0 -26
- package/locales/zh-TW/components.json +15 -0
- package/locales/zh-TW/error.json +1 -52
- package/locales/zh-TW/modelProvider.json +226 -0
- package/locales/zh-TW/setting.json +48 -199
- package/package.json +120 -116
- package/scripts/mdxWorkflow/index.ts +48 -0
- package/src/app/api/chat/[provider]/route.test.ts +4 -9
- package/src/app/api/chat/[provider]/route.ts +6 -23
- package/src/app/api/chat/{[provider]/agentRuntime.test.ts → agentRuntime.test.ts} +12 -12
- package/src/app/api/chat/{[provider]/agentRuntime.ts → agentRuntime.ts} +11 -30
- package/src/app/api/chat/auth/index.ts +42 -0
- package/src/app/api/chat/models/[provider]/route.ts +45 -0
- package/src/app/api/config/__snapshots__/route.test.ts.snap +127 -0
- package/src/app/api/config/route.test.ts +170 -0
- package/src/app/api/config/route.ts +46 -11
- package/src/app/api/plugin/gateway/route.ts +1 -1
- package/src/app/settings/llm/Azure/index.tsx +36 -43
- package/src/app/settings/llm/Bedrock/index.tsx +12 -20
- package/src/app/settings/llm/Ollama/index.tsx +2 -2
- package/src/app/settings/llm/OpenAI/index.tsx +9 -121
- package/src/app/settings/llm/OpenRouter/index.tsx +1 -1
- package/src/app/settings/llm/TogetherAI/index.tsx +0 -1
- package/src/app/settings/llm/components/ProviderConfig/index.tsx +48 -32
- package/src/app/settings/llm/components/ProviderModelList/CustomModelOption.tsx +94 -0
- package/src/app/settings/llm/components/ProviderModelList/MaxTokenSlider.tsx +88 -0
- package/src/app/settings/llm/components/ProviderModelList/ModelConfigModal.tsx +128 -0
- package/src/app/settings/llm/components/ProviderModelList/ModelFetcher.tsx +81 -0
- package/src/app/settings/llm/components/ProviderModelList/Option.tsx +38 -0
- package/src/app/settings/llm/components/ProviderModelList/index.tsx +142 -0
- package/src/app/settings/llm/const.ts +1 -1
- package/src/app/settings/llm/index.tsx +7 -6
- package/src/app/settings/tts/TTS/index.tsx +1 -1
- package/src/components/AntdStaticMethods/index.test.tsx +43 -0
- package/src/components/ModelIcon/index.tsx +25 -7
- package/src/components/ModelSelect/index.tsx +67 -56
- package/src/config/modelProviders/anthropic.ts +6 -1
- package/src/config/modelProviders/azure.ts +42 -0
- package/src/config/modelProviders/bedrock.ts +4 -1
- package/src/config/modelProviders/google.ts +2 -14
- package/src/config/modelProviders/groq.ts +3 -0
- package/src/config/modelProviders/index.ts +19 -14
- package/src/config/modelProviders/mistral.ts +5 -0
- package/src/config/modelProviders/moonshot.ts +3 -1
- package/src/config/modelProviders/ollama.ts +6 -17
- package/src/config/modelProviders/openai.ts +9 -13
- package/src/config/modelProviders/openrouter.ts +6 -1
- package/src/config/modelProviders/perplexity.ts +2 -0
- package/src/config/modelProviders/togetherai.ts +11 -0
- package/src/config/modelProviders/zeroone.ts +3 -0
- package/src/config/modelProviders/zhipu.ts +3 -0
- package/src/config/server/provider.ts +52 -7
- package/src/const/auth.ts +0 -1
- package/src/const/{settings.ts → settings/index.ts} +31 -4
- package/src/const/url.ts +1 -1
- package/src/database/core/db.ts +14 -0
- package/src/database/schemas/user.ts +1 -25
- package/src/features/AgentSetting/AgentConfig/ModelSelect.tsx +7 -11
- package/src/features/ChatInput/STT/common.tsx +80 -78
- package/src/features/ChatInput/STT/index.tsx +8 -6
- package/src/features/Conversation/Error/APIKeyForm/Bedrock.tsx +8 -8
- package/src/features/Conversation/Error/APIKeyForm/ProviderApiKeyForm.tsx +73 -0
- package/src/features/Conversation/Error/APIKeyForm/ProviderAvatar.tsx +74 -0
- package/src/features/Conversation/Error/APIKeyForm/index.tsx +25 -49
- package/src/features/ModelSwitchPanel/index.tsx +40 -13
- package/src/hooks/_header.ts +5 -20
- package/src/libs/agent-runtime/BaseAI.ts +17 -1
- package/src/libs/agent-runtime/anthropic/index.ts +3 -7
- package/src/libs/agent-runtime/azureOpenai/index.test.ts +166 -0
- package/src/libs/agent-runtime/azureOpenai/index.ts +16 -8
- package/src/libs/agent-runtime/bedrock/index.test.ts +199 -22
- package/src/libs/agent-runtime/bedrock/index.ts +11 -18
- package/src/libs/agent-runtime/groq/index.test.ts +350 -0
- package/src/libs/agent-runtime/groq/index.ts +14 -77
- package/src/libs/agent-runtime/mistral/index.test.ts +25 -19
- package/src/libs/agent-runtime/mistral/index.ts +24 -86
- package/src/libs/agent-runtime/moonshot/index.test.ts +2 -2
- package/src/libs/agent-runtime/moonshot/index.ts +14 -77
- package/src/libs/agent-runtime/openai/__snapshots__/index.test.ts.snap +99 -0
- package/src/libs/agent-runtime/openai/fixtures/openai-models.json +170 -0
- package/src/libs/agent-runtime/openai/index.test.ts +15 -50
- package/src/libs/agent-runtime/openai/index.ts +15 -107
- package/src/libs/agent-runtime/openrouter/__snapshots__/index.test.ts.snap +82 -0
- package/src/libs/agent-runtime/openrouter/fixtures/models.json +62 -0
- package/src/libs/agent-runtime/openrouter/index.test.ts +25 -9
- package/src/libs/agent-runtime/openrouter/index.ts +42 -84
- package/src/libs/agent-runtime/openrouter/type.ts +28 -0
- package/src/libs/agent-runtime/togetherai/index.test.ts +12 -9
- package/src/libs/agent-runtime/togetherai/index.ts +20 -85
- package/src/libs/agent-runtime/utils/anthropicHelpers.test.ts +14 -22
- package/src/libs/agent-runtime/utils/anthropicHelpers.ts +4 -10
- package/src/libs/agent-runtime/utils/openaiCompatibleFactory/index.ts +147 -0
- package/src/libs/agent-runtime/zeroone/index.test.ts +350 -0
- package/src/libs/agent-runtime/zeroone/index.ts +14 -77
- package/src/locales/default/common.ts +0 -28
- package/src/locales/default/components.ts +15 -0
- package/src/locales/default/error.ts +2 -54
- package/src/locales/default/index.ts +4 -0
- package/src/locales/default/modelProvider.ts +229 -0
- package/src/locales/default/setting.ts +51 -202
- package/src/migrations/FromV3ToV4/fixtures/azure-input-v3.json +79 -0
- package/src/migrations/FromV3ToV4/fixtures/azure-output-v4.json +75 -0
- package/src/migrations/FromV3ToV4/fixtures/ollama-input-v3.json +85 -0
- package/src/migrations/FromV3ToV4/fixtures/ollama-output-v4.json +86 -0
- package/src/migrations/FromV3ToV4/fixtures/openai-input-v3.json +77 -0
- package/src/migrations/FromV3ToV4/fixtures/openai-output-v4.json +79 -0
- package/src/migrations/FromV3ToV4/fixtures/openrouter-input-v3.json +82 -0
- package/src/migrations/FromV3ToV4/fixtures/openrouter-output-v4.json +89 -0
- package/src/migrations/FromV3ToV4/fixtures/output-v4-from-v1.json +203 -0
- package/src/migrations/FromV3ToV4/index.ts +96 -0
- package/src/migrations/FromV3ToV4/migrations.test.ts +195 -0
- package/src/migrations/FromV3ToV4/types/v3.ts +59 -0
- package/src/migrations/FromV3ToV4/types/v4.ts +37 -0
- package/src/migrations/index.ts +11 -3
- package/src/services/_auth.test.ts +4 -6
- package/src/services/_auth.ts +8 -60
- package/src/services/_header.ts +5 -22
- package/src/services/_url.ts +1 -0
- package/src/services/chat.ts +16 -6
- package/src/services/global.ts +1 -1
- package/src/services/models.ts +23 -0
- package/src/services/ollama.ts +2 -2
- package/src/store/chat/slices/share/action.test.ts +113 -0
- package/src/store/chat/slices/share/action.ts +1 -1
- package/src/store/global/slices/common/action.test.ts +166 -1
- package/src/store/global/slices/common/action.ts +2 -1
- package/src/store/global/slices/settings/{action.test.ts → actions/general.test.ts} +1 -19
- package/src/store/global/slices/settings/{action.ts → actions/general.ts} +4 -19
- package/src/store/global/slices/settings/actions/index.ts +18 -0
- package/src/store/global/slices/settings/actions/llm.test.ts +60 -0
- package/src/store/global/slices/settings/actions/llm.ts +88 -0
- package/src/store/global/slices/settings/initialState.ts +3 -1
- package/src/store/global/slices/settings/reducers/customModelCard.test.ts +204 -0
- package/src/store/global/slices/settings/reducers/customModelCard.ts +64 -0
- package/src/store/global/slices/settings/selectors/index.ts +1 -0
- package/src/store/global/slices/settings/selectors/modelConfig.test.ts +189 -0
- package/src/store/global/slices/settings/selectors/modelConfig.ts +179 -0
- package/src/store/global/slices/settings/selectors/modelProvider.test.ts +47 -138
- package/src/store/global/slices/settings/selectors/modelProvider.ts +102 -243
- package/src/store/global/store.ts +1 -1
- package/src/types/llm.ts +12 -1
- package/src/types/serverConfig.ts +22 -0
- package/src/types/settings/index.ts +0 -12
- package/src/types/settings/modelProvider.ts +34 -90
- package/src/utils/client/switchLang.test.ts +34 -0
- package/src/utils/difference.test.ts +46 -0
- package/src/utils/difference.ts +15 -2
- package/src/utils/fetch.ts +1 -3
- package/src/utils/parseModels.ts +62 -0
- package/vercel.json +1 -1
- package/docs/package.json +0 -5
- package/src/features/Conversation/Error/APIKeyForm/Anthropic.tsx +0 -40
- package/src/features/Conversation/Error/APIKeyForm/Google.tsx +0 -61
- package/src/features/Conversation/Error/APIKeyForm/Groq.tsx +0 -60
- package/src/features/Conversation/Error/APIKeyForm/Mistral.tsx +0 -60
- package/src/features/Conversation/Error/APIKeyForm/Moonshot.tsx +0 -60
- package/src/features/Conversation/Error/APIKeyForm/OpenAI.tsx +0 -63
- package/src/features/Conversation/Error/APIKeyForm/OpenRouter.tsx +0 -40
- package/src/features/Conversation/Error/APIKeyForm/Perplexity.tsx +0 -60
- package/src/features/Conversation/Error/APIKeyForm/TogetherAI.tsx +0 -40
- package/src/features/Conversation/Error/APIKeyForm/ZeroOne.tsx +0 -60
- package/src/features/Conversation/Error/APIKeyForm/Zhipu.tsx +0 -62
- package/src/libs/agent-runtime/utils/env.ts +0 -1
- package/src/store/global/slices/settings/selectors/__snapshots__/modelProvider.test.ts.snap +0 -230
- /package/src/app/api/chat/{auth.ts → auth/utils.ts} +0 -0
- /package/src/components/{AntdStaticMethods.tsx → AntdStaticMethods/index.tsx} +0 -0
|
@@ -31,215 +31,63 @@
|
|
|
31
31
|
"sessionWithName": "對話設定 · {{name}}"
|
|
32
32
|
},
|
|
33
33
|
"llm": {
|
|
34
|
-
"anthropic": {
|
|
35
|
-
"endpoint": {
|
|
36
|
-
"desc": "除了預設地址外,必須包含 http(s)://",
|
|
37
|
-
"placeholder": "https://api.anthropic.com",
|
|
38
|
-
"title": "API 代理地址"
|
|
39
|
-
},
|
|
40
|
-
"title": "Anthropic",
|
|
41
|
-
"token": {
|
|
42
|
-
"desc": "填入來自 Anthropics 的 API Key",
|
|
43
|
-
"placeholder": "Anthropic API Key",
|
|
44
|
-
"title": "API Key"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"azure": {
|
|
48
|
-
"azureApiVersion": {
|
|
49
|
-
"desc": "Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查閱[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
|
|
50
|
-
"fetch": "獲取列表",
|
|
51
|
-
"title": "Azure API 版本"
|
|
52
|
-
},
|
|
53
|
-
"deployments": {
|
|
54
|
-
"desc": "使用 id=name 的語法填寫你的部署模型(如部署名和模型同名,可以只填寫模型名稱),多個模型使用逗號(,) 隔開",
|
|
55
|
-
"title": "Azure 部署模型列表"
|
|
56
|
-
},
|
|
57
|
-
"endpoint": {
|
|
58
|
-
"desc": "從 Azure 門戶檢查資源時,可在「密鑰和終端點」部分中找到此值",
|
|
59
|
-
"placeholder": "https://docs-test-001.openai.azure.com",
|
|
60
|
-
"title": "Azure API 地址"
|
|
61
|
-
},
|
|
62
|
-
"models": {
|
|
63
|
-
"desc": "支援的模型",
|
|
64
|
-
"title": "模型列表"
|
|
65
|
-
},
|
|
66
|
-
"title": "Azure OpenAI",
|
|
67
|
-
"token": {
|
|
68
|
-
"desc": "從 Azure 門戶檢查資源時,可在「密鑰和終端點」部分中找到此值。 可以使用 KEY1 或 KEY2",
|
|
69
|
-
"placeholder": "Azure API Key",
|
|
70
|
-
"title": "API Key"
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"bedrock": {
|
|
74
|
-
"accessKeyId": {
|
|
75
|
-
"desc": "填入 AWS Access Key ID",
|
|
76
|
-
"placeholder": "AWS Access Key ID",
|
|
77
|
-
"title": "AWS Access Key ID"
|
|
78
|
-
},
|
|
79
|
-
"checker": {
|
|
80
|
-
"desc": "測試 AccessKeyId / SecretAccessKey 是否填寫正確"
|
|
81
|
-
},
|
|
82
|
-
"region": {
|
|
83
|
-
"desc": "填入 AWS Region",
|
|
84
|
-
"placeholder": "AWS Region",
|
|
85
|
-
"title": "AWS Region"
|
|
86
|
-
},
|
|
87
|
-
"secretAccessKey": {
|
|
88
|
-
"desc": "填入 AWS Secret Access Key",
|
|
89
|
-
"placeholder": "AWS Secret Access Key",
|
|
90
|
-
"title": "AWS Secret Access Key"
|
|
91
|
-
},
|
|
92
|
-
"title": "Bedrock"
|
|
93
|
-
},
|
|
94
34
|
"checker": {
|
|
95
35
|
"button": "檢查",
|
|
96
36
|
"desc": "測試 API 金鑰與代理地址是否正確填寫",
|
|
37
|
+
"ollamaDesc": "測試代理地址是否正確填寫",
|
|
97
38
|
"pass": "檢查通過",
|
|
98
39
|
"title": "連通性檢查"
|
|
99
40
|
},
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
"customModelName": {
|
|
137
|
-
"desc": "新增自定義模型,多個模型使用逗號(,)隔開",
|
|
138
|
-
"placeholder": "vicuna,llava,codellama,llama2:13b-text",
|
|
139
|
-
"title": "自定義模型名稱"
|
|
140
|
-
},
|
|
141
|
-
"endpoint": {
|
|
142
|
-
"desc": "填入 Ollama 接口代理地址,本地未額外指定可留空",
|
|
143
|
-
"placeholder": "http://127.0.0.1:11434/v1",
|
|
144
|
-
"title": "接口代理地址"
|
|
145
|
-
},
|
|
146
|
-
"title": "Ollama"
|
|
147
|
-
},
|
|
148
|
-
"openai": {
|
|
149
|
-
"azureApiVersion": {
|
|
150
|
-
"desc": "Azure 的 API 版本,遵循 YYYY-MM-DD 格式,查閱[最新版本](https://learn.microsoft.com/zh-cn/azure/ai-services/openai/reference#chat-completions)",
|
|
151
|
-
"fetch": "獲取列表",
|
|
152
|
-
"title": "Azure Api 版本"
|
|
153
|
-
},
|
|
154
|
-
"customModelName": {
|
|
155
|
-
"desc": "增加自訂模型,多個模型使用逗號(,) 隔開",
|
|
156
|
-
"placeholder": "model1,model2,model3",
|
|
157
|
-
"title": "自訂模型名稱"
|
|
158
|
-
},
|
|
159
|
-
"endpoint": {
|
|
160
|
-
"desc": "除預設地址外,必須包含 http(s)://",
|
|
161
|
-
"placeholder": "https://api.openai.com/v1",
|
|
162
|
-
"title": "接口代理地址"
|
|
163
|
-
},
|
|
164
|
-
"models": {
|
|
165
|
-
"count": "共支援 {{count}} 個模型",
|
|
166
|
-
"desc": "支援的模型",
|
|
167
|
-
"fetch": "獲取模型列表",
|
|
168
|
-
"notSupport": "Azure OpenAI 暫不支援查看模型列表",
|
|
169
|
-
"notSupportTip": "你需要自行確保部署名稱與模型名稱一致",
|
|
170
|
-
"refetch": "重新獲取模型列表",
|
|
171
|
-
"title": "模型列表"
|
|
172
|
-
},
|
|
173
|
-
"title": "OpenAI",
|
|
174
|
-
"token": {
|
|
175
|
-
"desc": "使用自己的 OpenAI Key",
|
|
176
|
-
"placeholder": "OpenAI API Key",
|
|
177
|
-
"title": "OpenAI API Key"
|
|
178
|
-
},
|
|
179
|
-
"useAzure": {
|
|
180
|
-
"desc": "使用 Azure 提供的 OpenAI 服務",
|
|
181
|
-
"fetch": "獲取列表",
|
|
182
|
-
"serverConfig": "管理員在服務端配置開啟了 Azure OpenAI,禁止切換",
|
|
183
|
-
"title": "Azure OpenAI"
|
|
41
|
+
"customModelCards": {
|
|
42
|
+
"addNew": "創建並添加 {{id}} 模型",
|
|
43
|
+
"config": "配置模型",
|
|
44
|
+
"confirmDelete": "即將刪除該自定義模型,刪除後將不可恢復,請謹慎操作。",
|
|
45
|
+
"modelConfig": {
|
|
46
|
+
"azureDeployName": {
|
|
47
|
+
"extra": "在 Azure OpenAI 中實際請求的字段",
|
|
48
|
+
"placeholder": "請輸入 Azure 中的模型部署名稱",
|
|
49
|
+
"title": "模型部署名稱"
|
|
50
|
+
},
|
|
51
|
+
"displayName": {
|
|
52
|
+
"placeholder": "請輸入模型的展示名稱,例如 ChatGPT、GPT-4 等",
|
|
53
|
+
"title": "模型展示名稱"
|
|
54
|
+
},
|
|
55
|
+
"files": {
|
|
56
|
+
"extra": "當前 LobeChat 的文件上傳實現僅為一種 Hack 方案,僅限自行嘗試。完整文件上傳能力請等待後續實現",
|
|
57
|
+
"title": "支援文件上傳"
|
|
58
|
+
},
|
|
59
|
+
"functionCall": {
|
|
60
|
+
"extra": "此配置將僅開啟 LobeChat 中的函數調用能力,是否支持函數調用完全取決於模型本身,請自行測試該模型的函數調用能力可用性",
|
|
61
|
+
"title": "支援函數調用"
|
|
62
|
+
},
|
|
63
|
+
"id": {
|
|
64
|
+
"extra": "將作為模型標籤進行展示",
|
|
65
|
+
"placeholder": "請輸入模型id,例如 gpt-4-turbo-preview 或 claude-2.1",
|
|
66
|
+
"title": "模型 ID"
|
|
67
|
+
},
|
|
68
|
+
"modalTitle": "自定義模型配置",
|
|
69
|
+
"tokens": {
|
|
70
|
+
"title": "最大 token 數"
|
|
71
|
+
},
|
|
72
|
+
"vision": {
|
|
73
|
+
"extra": "此配置將僅開啟 LobeChat 中的圖片上傳配置,是否支持識別完全取決於模型本身,請自行測試該模型的視覺識別能力可用性",
|
|
74
|
+
"title": "支援視覺識別"
|
|
75
|
+
}
|
|
184
76
|
}
|
|
185
77
|
},
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
"
|
|
191
|
-
"desc": "增加自定義模型,多個模型使用逗號(,)隔開",
|
|
192
|
-
"placeholder": "mistralai/mistral-7b-instruct:free,openchat/openchat-7b:free",
|
|
193
|
-
"title": "自定義模型名稱"
|
|
194
|
-
},
|
|
195
|
-
"title": "OpenRouter",
|
|
196
|
-
"token": {
|
|
197
|
-
"desc": "填入來自 OpenRouter AI 的 API Key",
|
|
198
|
-
"placeholder": "OpenRouter AI API Key",
|
|
199
|
-
"title": "API Key"
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
"perplexity": {
|
|
203
|
-
"title": "Perplexity",
|
|
204
|
-
"token": {
|
|
205
|
-
"desc": "填入來自 Perplexity AI 的 API Key",
|
|
206
|
-
"placeholder": "Perplexity AI API Key",
|
|
207
|
-
"title": "API Key"
|
|
208
|
-
}
|
|
78
|
+
"fetcher": {
|
|
79
|
+
"fetch": "獲取模型列表",
|
|
80
|
+
"fetching": "正在獲取模型列表...",
|
|
81
|
+
"latestTime": "上次更新時間:{{time}}",
|
|
82
|
+
"noLatestTime": "暫未獲取列表"
|
|
209
83
|
},
|
|
210
|
-
"
|
|
211
|
-
"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"
|
|
215
|
-
"desc": "增加自定義模型,多個模型使用逗號(,)隔開",
|
|
216
|
-
"placeholder": "mistralai/mistral-7b-instruct:free,openchat/openchat-7b:free",
|
|
217
|
-
"title": "自定義模型名稱"
|
|
218
|
-
},
|
|
219
|
-
"title": "TogetherAI",
|
|
220
|
-
"token": {
|
|
221
|
-
"desc": "填入來自 TogetherAI AI 的 API Key",
|
|
222
|
-
"placeholder": "TogetherAI AI API Key",
|
|
223
|
-
"title": "API Key"
|
|
224
|
-
}
|
|
84
|
+
"modelList": {
|
|
85
|
+
"desc": "選擇在會話中展示的模型,選擇的模型會在模型列表中展示",
|
|
86
|
+
"placeholder": "請從列表中選擇模型",
|
|
87
|
+
"title": "模型列表",
|
|
88
|
+
"total": "共 {{count}} 個模型可用"
|
|
225
89
|
},
|
|
226
|
-
"waitingForMore": "更多模型正在 <1>計劃接入</1> 中,敬請期待 ✨"
|
|
227
|
-
"zeroone": {
|
|
228
|
-
"title": "01.AI 零一萬物",
|
|
229
|
-
"token": {
|
|
230
|
-
"desc": "填入來自 01.AI 零一萬物的 API Key",
|
|
231
|
-
"placeholder": "01.AI 零一萬物 API Key",
|
|
232
|
-
"title": "API Key"
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
"zhipu": {
|
|
236
|
-
"title": "智譜",
|
|
237
|
-
"token": {
|
|
238
|
-
"desc": "填入來自智譜的 API Key",
|
|
239
|
-
"placeholder": "Zhipu API Key",
|
|
240
|
-
"title": "API Key"
|
|
241
|
-
}
|
|
242
|
-
}
|
|
90
|
+
"waitingForMore": "更多模型正在 <1>計劃接入</1> 中,敬請期待 ✨"
|
|
243
91
|
},
|
|
244
92
|
"ollama": {
|
|
245
93
|
"download": {
|
|
@@ -395,6 +243,7 @@
|
|
|
395
243
|
"settingTTS": {
|
|
396
244
|
"openai": {
|
|
397
245
|
"sttModel": "OpenAI 語音識別模型",
|
|
246
|
+
"title": "OpenAI",
|
|
398
247
|
"ttsModel": "OpenAI 語音合成模型"
|
|
399
248
|
},
|
|
400
249
|
"showAllLocaleVoice": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.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",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"build:analyze": "ANALYZE=true next build",
|
|
33
33
|
"build:docker": "DOCKER=true next build && npm run build-sitemap",
|
|
34
34
|
"dev": "next dev -p 3010",
|
|
35
|
-
"docs": "lobe-i18n md && npm run workflow:docs",
|
|
35
|
+
"docs:i18n": "lobe-i18n md && npm run workflow:docs && npm run lint:mdx",
|
|
36
|
+
"docs:seo": "lobe-seo && npm run workflow:mdx && npm run lint:mdx",
|
|
36
37
|
"i18n": "npm run workflow:i18n && lobe-i18n",
|
|
37
|
-
"i18n:docs": "lobe-i18n md && npm run workflow:docs",
|
|
38
38
|
"lint": "npm run lint:ts && npm run lint:style && npm run type-check && npm run lint:circular",
|
|
39
39
|
"lint:circular": "dpdm src/**/*.ts --warning false --tree false --exit-code circular:1 -T true --skip-dynamic-imports circular",
|
|
40
40
|
"lint:md": "remark . --quiet --frail --output",
|
|
41
|
-
"lint:mdx": "eslint \"{contributing,docs}/**/*.mdx\" --fix",
|
|
41
|
+
"lint:mdx": "eslint \"{contributing,docs}/**/*.mdx\" --quiet --fix",
|
|
42
42
|
"lint:style": "stylelint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
43
43
|
"lint:ts": "eslint \"{src,tests}/**/*.{js,jsx,ts,tsx}\" --fix",
|
|
44
44
|
"prepare": "husky",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"type-check": "tsc --noEmit",
|
|
54
54
|
"workflow:docs": "tsx scripts/docsWorkflow/index.ts",
|
|
55
55
|
"workflow:i18n": "tsx scripts/i18nWorkflow/index.ts",
|
|
56
|
+
"workflow:mdx": "tsx scripts/mdxWorkflow/index.ts",
|
|
56
57
|
"workflow:readme": "tsx scripts/readmeWorkflow/index.ts"
|
|
57
58
|
},
|
|
58
59
|
"lint-staged": {
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
"prettier --write --no-error-on-unmatched-pattern"
|
|
62
63
|
],
|
|
63
64
|
"*.mdx": [
|
|
64
|
-
"
|
|
65
|
+
"npm run workflow:mdx",
|
|
66
|
+
"eslint --quiet --fix"
|
|
65
67
|
],
|
|
66
68
|
"*.json": [
|
|
67
69
|
"prettier --write --no-error-on-unmatched-pattern"
|
|
@@ -78,143 +80,145 @@
|
|
|
78
80
|
]
|
|
79
81
|
},
|
|
80
82
|
"dependencies": {
|
|
81
|
-
"@ant-design/icons": "^5",
|
|
83
|
+
"@ant-design/icons": "^5.3.6",
|
|
82
84
|
"@anthropic-ai/sdk": "^0.18.0",
|
|
83
85
|
"@auth/core": "0.28.0",
|
|
84
|
-
"@aws-sdk/client-bedrock-runtime": "^3.
|
|
85
|
-
"@azure/openai": "^1.0.0-beta.
|
|
86
|
-
"@cfworker/json-schema": "^1",
|
|
86
|
+
"@aws-sdk/client-bedrock-runtime": "^3.549.0",
|
|
87
|
+
"@azure/openai": "^1.0.0-beta.12",
|
|
88
|
+
"@cfworker/json-schema": "^1.12.8",
|
|
87
89
|
"@google/generative-ai": "^0.3.1",
|
|
88
|
-
"@icons-pack/react-simple-icons": "^9",
|
|
90
|
+
"@icons-pack/react-simple-icons": "^9.4.0",
|
|
89
91
|
"@lobehub/chat-plugin-sdk": "latest",
|
|
90
92
|
"@lobehub/chat-plugins-gateway": "latest",
|
|
91
93
|
"@lobehub/icons": "latest",
|
|
92
94
|
"@lobehub/tts": "latest",
|
|
93
|
-
"@lobehub/ui": "^1.137.
|
|
95
|
+
"@lobehub/ui": "^1.137.7",
|
|
94
96
|
"@next/third-parties": "^14.1.4",
|
|
95
|
-
"@vercel/analytics": "^1",
|
|
97
|
+
"@vercel/analytics": "^1.2.2",
|
|
96
98
|
"@vercel/speed-insights": "^1.0.10",
|
|
97
|
-
"ahooks": "^3",
|
|
99
|
+
"ahooks": "^3.7.11",
|
|
98
100
|
"ai": "3.0.19",
|
|
99
|
-
"antd": "^5",
|
|
100
|
-
"antd-style": "^3",
|
|
101
|
-
"brotli-wasm": "^2",
|
|
102
|
-
"chroma-js": "^2",
|
|
103
|
-
"dayjs": "^1",
|
|
104
|
-
"debug": "^4",
|
|
105
|
-
"dexie": "^3",
|
|
106
|
-
"diff": "^5",
|
|
107
|
-
"fast-deep-equal": "^3",
|
|
108
|
-
"gpt-tokenizer": "^2",
|
|
109
|
-
"i18next": "^23",
|
|
110
|
-
"i18next-browser-languagedetector": "^7",
|
|
111
|
-
"i18next-resources-to-backend": "^1",
|
|
112
|
-
"idb-keyval": "^6",
|
|
113
|
-
"immer": "^10",
|
|
114
|
-
"jose": "^5",
|
|
115
|
-
"langfuse": "^3",
|
|
116
|
-
"langfuse-core": "^3",
|
|
117
|
-
"lodash-es": "^4",
|
|
101
|
+
"antd": "^5.16.1",
|
|
102
|
+
"antd-style": "^3.6.2",
|
|
103
|
+
"brotli-wasm": "^2.0.1",
|
|
104
|
+
"chroma-js": "^2.4.2",
|
|
105
|
+
"dayjs": "^1.11.10",
|
|
106
|
+
"debug": "^4.3.4",
|
|
107
|
+
"dexie": "^3.2.7",
|
|
108
|
+
"diff": "^5.2.0",
|
|
109
|
+
"fast-deep-equal": "^3.1.3",
|
|
110
|
+
"gpt-tokenizer": "^2.1.2",
|
|
111
|
+
"i18next": "^23.11.0",
|
|
112
|
+
"i18next-browser-languagedetector": "^7.2.1",
|
|
113
|
+
"i18next-resources-to-backend": "^1.2.0",
|
|
114
|
+
"idb-keyval": "^6.2.1",
|
|
115
|
+
"immer": "^10.0.4",
|
|
116
|
+
"jose": "^5.2.4",
|
|
117
|
+
"langfuse": "^3.4.0",
|
|
118
|
+
"langfuse-core": "^3.4.0",
|
|
119
|
+
"lodash-es": "^4.17.21",
|
|
118
120
|
"lucide-react": "latest",
|
|
119
|
-
"modern-screenshot": "^4",
|
|
120
|
-
"nanoid": "^5",
|
|
121
|
-
"next": "^14.1",
|
|
121
|
+
"modern-screenshot": "^4.4.38",
|
|
122
|
+
"nanoid": "^5.0.7",
|
|
123
|
+
"next": "^14.1.4",
|
|
122
124
|
"next-auth": "5.0.0-beta.15",
|
|
123
|
-
"next-sitemap": "^4",
|
|
124
|
-
"numeral": "^2",
|
|
125
|
-
"nuqs": "^1",
|
|
125
|
+
"next-sitemap": "^4.2.3",
|
|
126
|
+
"numeral": "^2.0.6",
|
|
127
|
+
"nuqs": "^1.17.1",
|
|
126
128
|
"ollama": "^0.5.0",
|
|
127
|
-
"openai": "^4.
|
|
128
|
-
"polished": "^4",
|
|
129
|
-
"posthog-js": "^1",
|
|
130
|
-
"query-string": "^9",
|
|
129
|
+
"openai": "^4.33.0",
|
|
130
|
+
"polished": "^4.3.1",
|
|
131
|
+
"posthog-js": "^1.120.2",
|
|
132
|
+
"query-string": "^9.0.0",
|
|
131
133
|
"random-words": "^2.0.1",
|
|
132
|
-
"react": "^18",
|
|
133
|
-
"react-dom": "^18",
|
|
134
|
-
"react-hotkeys-hook": "^4",
|
|
135
|
-
"react-i18next": "^14",
|
|
134
|
+
"react": "^18.2.0",
|
|
135
|
+
"react-dom": "^18.2.0",
|
|
136
|
+
"react-hotkeys-hook": "^4.5.0",
|
|
137
|
+
"react-i18next": "^14.1.0",
|
|
136
138
|
"react-layout-kit": "^1.9.0",
|
|
137
|
-
"react-lazy-load": "^4",
|
|
138
|
-
"react-virtuoso": "^4",
|
|
139
|
-
"react-wrap-balancer": "^1",
|
|
140
|
-
"remark": "^14",
|
|
141
|
-
"remark-gfm": "^3",
|
|
142
|
-
"remark-html": "^15",
|
|
143
|
-
"rtl-detect": "^1",
|
|
144
|
-
"semver": "^7",
|
|
145
|
-
"sharp": "^0.33",
|
|
146
|
-
"swr": "^2",
|
|
147
|
-
"systemjs": "^6",
|
|
148
|
-
"ts-md5": "^1",
|
|
149
|
-
"ua-parser-js": "^1",
|
|
150
|
-
"url-join": "^5",
|
|
151
|
-
"use-merge-value": "^1",
|
|
152
|
-
"utility-types": "^3",
|
|
153
|
-
"uuid": "^9",
|
|
139
|
+
"react-lazy-load": "^4.0.1",
|
|
140
|
+
"react-virtuoso": "^4.7.8",
|
|
141
|
+
"react-wrap-balancer": "^1.1.0",
|
|
142
|
+
"remark": "^14.0.3",
|
|
143
|
+
"remark-gfm": "^3.0.1",
|
|
144
|
+
"remark-html": "^15.0.2",
|
|
145
|
+
"rtl-detect": "^1.1.2",
|
|
146
|
+
"semver": "^7.6.0",
|
|
147
|
+
"sharp": "^0.33.3",
|
|
148
|
+
"swr": "^2.2.5",
|
|
149
|
+
"systemjs": "^6.14.3",
|
|
150
|
+
"ts-md5": "^1.3.1",
|
|
151
|
+
"ua-parser-js": "^1.0.37",
|
|
152
|
+
"url-join": "^5.0.0",
|
|
153
|
+
"use-merge-value": "^1.2.0",
|
|
154
|
+
"utility-types": "^3.11.0",
|
|
155
|
+
"uuid": "^9.0.1",
|
|
154
156
|
"y-protocols": "^1.0.6",
|
|
155
157
|
"y-webrtc": "^10.3.0",
|
|
156
|
-
"yaml": "^2",
|
|
158
|
+
"yaml": "^2.4.1",
|
|
157
159
|
"yjs": "^13.6.14",
|
|
158
|
-
"zod": "^3",
|
|
160
|
+
"zod": "^3.22.4",
|
|
159
161
|
"zustand": "^4.5.2",
|
|
160
162
|
"zustand-utils": "^1.3.2"
|
|
161
163
|
},
|
|
162
164
|
"devDependencies": {
|
|
163
|
-
"@commitlint/cli": "^19",
|
|
164
|
-
"@ducanh2912/next-pwa": "^10",
|
|
165
|
-
"@edge-runtime/vm": "^3",
|
|
166
|
-
"@lobehub/i18n-cli": "
|
|
167
|
-
"@lobehub/lint": "
|
|
168
|
-
"@
|
|
169
|
-
"@next/
|
|
170
|
-
"@
|
|
171
|
-
"@
|
|
172
|
-
"@testing-library/
|
|
173
|
-
"@
|
|
165
|
+
"@commitlint/cli": "^19.2.1",
|
|
166
|
+
"@ducanh2912/next-pwa": "^10.2.6",
|
|
167
|
+
"@edge-runtime/vm": "^3.2.0",
|
|
168
|
+
"@lobehub/i18n-cli": "^1.18.1",
|
|
169
|
+
"@lobehub/lint": "^1.23.3",
|
|
170
|
+
"@lobehub/seo-cli": "^1.4.1",
|
|
171
|
+
"@next/bundle-analyzer": "^14.1.4",
|
|
172
|
+
"@next/eslint-plugin-next": "^14.1.4",
|
|
173
|
+
"@peculiar/webcrypto": "^1.4.6",
|
|
174
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
175
|
+
"@testing-library/react": "^14.3.0",
|
|
176
|
+
"@types/chroma-js": "^2.4.4",
|
|
174
177
|
"@types/debug": "^4.1.12",
|
|
175
|
-
"@types/diff": "^5",
|
|
176
|
-
"@types/json-schema": "^7",
|
|
177
|
-
"@types/lodash": "^4",
|
|
178
|
-
"@types/lodash-es": "^4",
|
|
179
|
-
"@types/node": "^20",
|
|
180
|
-
"@types/numeral": "^2",
|
|
181
|
-
"@types/react": "^18.2.
|
|
182
|
-
"@types/react-dom": "^18",
|
|
183
|
-
"@types/rtl-detect": "^1",
|
|
184
|
-
"@types/semver": "^7",
|
|
185
|
-
"@types/systemjs": "^6",
|
|
186
|
-
"@types/ua-parser-js": "^0.7",
|
|
187
|
-
"@types/uuid": "^9",
|
|
188
|
-
"@umijs/lint": "^4",
|
|
178
|
+
"@types/diff": "^5.0.9",
|
|
179
|
+
"@types/json-schema": "^7.0.15",
|
|
180
|
+
"@types/lodash": "^4.17.0",
|
|
181
|
+
"@types/lodash-es": "^4.17.12",
|
|
182
|
+
"@types/node": "^20.12.6",
|
|
183
|
+
"@types/numeral": "^2.0.5",
|
|
184
|
+
"@types/react": "^18.2.75",
|
|
185
|
+
"@types/react-dom": "^18.2.24",
|
|
186
|
+
"@types/rtl-detect": "^1.0.3",
|
|
187
|
+
"@types/semver": "^7.5.8",
|
|
188
|
+
"@types/systemjs": "^6.13.5",
|
|
189
|
+
"@types/ua-parser-js": "^0.7.39",
|
|
190
|
+
"@types/uuid": "^9.0.8",
|
|
191
|
+
"@umijs/lint": "^4.1.8",
|
|
189
192
|
"@vitest/coverage-v8": "~1.2.2",
|
|
190
|
-
"ajv-keywords": "^5",
|
|
191
|
-
"commitlint": "^19",
|
|
192
|
-
"consola": "^3",
|
|
193
|
-
"dpdm": "^3",
|
|
194
|
-
"eslint": "^8",
|
|
195
|
-
"eslint-plugin-mdx": "^2",
|
|
196
|
-
"fake-indexeddb": "^5",
|
|
197
|
-
"glob": "^10",
|
|
198
|
-
"
|
|
193
|
+
"ajv-keywords": "^5.1.0",
|
|
194
|
+
"commitlint": "^19.2.1",
|
|
195
|
+
"consola": "^3.2.3",
|
|
196
|
+
"dpdm": "^3.14.0",
|
|
197
|
+
"eslint": "^8.57.0",
|
|
198
|
+
"eslint-plugin-mdx": "^2.3.4",
|
|
199
|
+
"fake-indexeddb": "^5.0.2",
|
|
200
|
+
"glob": "^10.3.12",
|
|
201
|
+
"gray-matter": "^4.0.3",
|
|
202
|
+
"husky": "^9.0.11",
|
|
199
203
|
"jsdom": "^24.0.0",
|
|
200
|
-
"just-diff": "^6",
|
|
201
|
-
"lint-staged": "^15",
|
|
202
|
-
"lodash": "^4",
|
|
203
|
-
"markdown-table": "^3",
|
|
204
|
-
"node-fetch": "^3",
|
|
205
|
-
"p-map": "^7",
|
|
206
|
-
"prettier": "^3",
|
|
207
|
-
"remark-cli": "^11",
|
|
208
|
-
"remark-parse": "^10",
|
|
209
|
-
"semantic-release": "^21",
|
|
210
|
-
"stylelint": "^15",
|
|
211
|
-
"tsx": "^4",
|
|
212
|
-
"typescript": "^5",
|
|
213
|
-
"unified": "^11",
|
|
214
|
-
"unist-util-visit": "^5",
|
|
215
|
-
"vite": "^5",
|
|
204
|
+
"just-diff": "^6.0.2",
|
|
205
|
+
"lint-staged": "^15.2.2",
|
|
206
|
+
"lodash": "^4.17.21",
|
|
207
|
+
"markdown-table": "^3.0.3",
|
|
208
|
+
"node-fetch": "^3.3.2",
|
|
209
|
+
"p-map": "^7.0.2",
|
|
210
|
+
"prettier": "^3.2.5",
|
|
211
|
+
"remark-cli": "^11.0.0",
|
|
212
|
+
"remark-parse": "^10.0.2",
|
|
213
|
+
"semantic-release": "^21.1.2",
|
|
214
|
+
"stylelint": "^15.11.0",
|
|
215
|
+
"tsx": "^4.7.2",
|
|
216
|
+
"typescript": "^5.4.4",
|
|
217
|
+
"unified": "^11.0.4",
|
|
218
|
+
"unist-util-visit": "^5.0.0",
|
|
219
|
+
"vite": "^5.2.8",
|
|
216
220
|
"vitest": "~1.2.2",
|
|
217
|
-
"vitest-canvas-mock": "^0.3"
|
|
221
|
+
"vitest-canvas-mock": "^0.3.3"
|
|
218
222
|
},
|
|
219
223
|
"publishConfig": {
|
|
220
224
|
"access": "public",
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { consola } from 'consola';
|
|
2
|
+
import { globSync } from 'glob';
|
|
3
|
+
import matter from 'gray-matter';
|
|
4
|
+
import { readFileSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
5
|
+
import { resolve } from 'node:path';
|
|
6
|
+
|
|
7
|
+
const fixWinPath = (path: string) => path.replaceAll('\\', '/');
|
|
8
|
+
|
|
9
|
+
export const root = resolve(__dirname, '../..');
|
|
10
|
+
|
|
11
|
+
const run = () => {
|
|
12
|
+
const posts = globSync(fixWinPath(resolve(root, 'docs/**/*.mdx')));
|
|
13
|
+
|
|
14
|
+
for (const post of posts) {
|
|
15
|
+
try {
|
|
16
|
+
const mdx = readFileSync(post, 'utf8');
|
|
17
|
+
if (!mdx || mdx.replaceAll(' ', '').replaceAll('\n', '') === '') {
|
|
18
|
+
consola.error(post, 'is EMPTY !!!!!');
|
|
19
|
+
unlinkSync(post);
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const { data, content } = matter(mdx);
|
|
23
|
+
const formatedContent = content
|
|
24
|
+
.replaceAll('\\<', '<')
|
|
25
|
+
.replaceAll("{' '}\n", '')
|
|
26
|
+
.replaceAll(`'<`, `'`)
|
|
27
|
+
.replaceAll(`"<`, `"`)
|
|
28
|
+
.replaceAll(`>'`, `'`)
|
|
29
|
+
.replaceAll(`>"`, `"`)
|
|
30
|
+
.replaceAll(' </', '\n</')
|
|
31
|
+
.replaceAll(' </', '\n</')
|
|
32
|
+
.replaceAll('}> width', '} width')
|
|
33
|
+
.replaceAll("'[https", "'https")
|
|
34
|
+
.replaceAll('"[https', '"https')
|
|
35
|
+
.replaceAll(/]\(http(.*)\/>\)/g, '')
|
|
36
|
+
.replaceAll(`\\*\\* `, '** ')
|
|
37
|
+
.replaceAll(` \\*\\*`, ' **')
|
|
38
|
+
.replaceAll(/\n{2,}/g, '\n\n');
|
|
39
|
+
|
|
40
|
+
writeFileSync(post, matter.stringify(formatedContent, data));
|
|
41
|
+
} catch (error) {
|
|
42
|
+
consola.error(post);
|
|
43
|
+
consola.error(error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
run();
|
|
@@ -5,11 +5,11 @@ import { LOBE_CHAT_AUTH_HEADER, OAUTH_AUTHORIZED } from '@/const/auth';
|
|
|
5
5
|
import { LobeRuntimeAI } from '@/libs/agent-runtime';
|
|
6
6
|
import { ChatErrorType } from '@/types/fetch';
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import AgentRuntime from '../agentRuntime';
|
|
9
|
+
import { getJWTPayload } from '../auth/utils';
|
|
10
10
|
import { POST } from './route';
|
|
11
11
|
|
|
12
|
-
vi.mock('../auth', () => ({
|
|
12
|
+
vi.mock('../auth/utils', () => ({
|
|
13
13
|
getJWTPayload: vi.fn(),
|
|
14
14
|
checkAuthMethod: vi.fn(),
|
|
15
15
|
}));
|
|
@@ -42,7 +42,6 @@ describe('POST handler', () => {
|
|
|
42
42
|
accessCode: 'test-access-code',
|
|
43
43
|
apiKey: 'test-api-key',
|
|
44
44
|
azureApiVersion: 'v1',
|
|
45
|
-
useAzure: true,
|
|
46
45
|
});
|
|
47
46
|
|
|
48
47
|
const mockRuntime: LobeRuntimeAI = { baseURL: 'abc', chat: vi.fn() };
|
|
@@ -56,11 +55,7 @@ describe('POST handler', () => {
|
|
|
56
55
|
|
|
57
56
|
// 验证是否正确调用了模拟函数
|
|
58
57
|
expect(getJWTPayload).toHaveBeenCalledWith('Bearer some-valid-token');
|
|
59
|
-
expect(spy).toHaveBeenCalledWith('test-provider', expect.anything()
|
|
60
|
-
apiVersion: 'v1',
|
|
61
|
-
model: 'test-model',
|
|
62
|
-
useAzure: true,
|
|
63
|
-
});
|
|
58
|
+
expect(spy).toHaveBeenCalledWith('test-provider', expect.anything());
|
|
64
59
|
});
|
|
65
60
|
|
|
66
61
|
it('should return Unauthorized error when LOBE_CHAT_AUTH_HEADER is missing', async () => {
|