@lobehub/chat 1.86.0 → 1.87.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/CHANGELOG.md +58 -0
- package/README.md +3 -3
- package/README.zh-CN.md +3 -3
- package/changelog/v1.json +21 -0
- package/locales/ar/setting.json +43 -31
- package/locales/bg-BG/setting.json +43 -31
- package/locales/de-DE/setting.json +43 -31
- package/locales/en-US/setting.json +43 -31
- package/locales/es-ES/setting.json +43 -31
- package/locales/fa-IR/setting.json +43 -31
- package/locales/fr-FR/setting.json +43 -31
- package/locales/it-IT/setting.json +43 -31
- package/locales/ja-JP/setting.json +43 -31
- package/locales/ko-KR/setting.json +43 -31
- package/locales/nl-NL/setting.json +43 -31
- package/locales/pl-PL/setting.json +43 -31
- package/locales/pt-BR/setting.json +43 -31
- package/locales/ru-RU/setting.json +43 -31
- package/locales/tr-TR/setting.json +43 -31
- package/locales/vi-VN/setting.json +43 -31
- package/locales/zh-CN/setting.json +43 -31
- package/locales/zh-TW/setting.json +43 -31
- package/package.json +3 -3
- package/src/app/(backend)/middleware/auth/index.test.ts +1 -1
- package/src/app/(backend)/middleware/auth/index.ts +1 -1
- package/src/app/(backend)/middleware/auth/utils.ts +1 -1
- package/src/app/(backend)/webapi/chat/[provider]/route.test.ts +1 -1
- package/src/app/(backend)/webapi/chat/[provider]/route.ts +1 -1
- package/src/app/(backend)/webapi/chat/vertexai/route.ts +2 -2
- package/src/app/(backend)/webapi/models/[provider]/pull/route.ts +1 -1
- package/src/app/(backend)/webapi/models/[provider]/route.ts +1 -1
- package/src/app/(backend)/webapi/plugin/gateway/route.ts +1 -1
- package/src/app/(backend)/webapi/text-to-image/[provider]/route.ts +2 -2
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/WelcomeChatItem/WelcomeMessage.tsx +1 -1
- package/src/app/[variants]/(main)/settings/agent/index.tsx +8 -2
- package/src/app/[variants]/(main)/settings/common/features/Appearance/Preview.tsx +298 -0
- package/src/app/[variants]/(main)/settings/common/features/{Theme → Appearance}/ThemeSwatches/ThemeSwatchesNeutral.tsx +6 -11
- package/src/app/[variants]/(main)/settings/common/features/{Theme → Appearance}/ThemeSwatches/ThemeSwatchesPrimary.tsx +6 -10
- package/src/app/[variants]/(main)/settings/common/features/Appearance/index.tsx +67 -0
- package/src/app/[variants]/(main)/settings/common/features/ChatAppearance/ChatPreview.tsx +35 -0
- package/src/app/[variants]/(main)/settings/common/features/ChatAppearance/HighlighterPreview.tsx +55 -0
- package/src/app/[variants]/(main)/settings/common/features/ChatAppearance/MermaidPreview.tsx +51 -0
- package/src/app/[variants]/(main)/settings/common/features/ChatAppearance/index.tsx +128 -0
- package/src/app/[variants]/(main)/settings/common/features/Common.tsx +74 -42
- package/src/app/[variants]/(main)/settings/common/index.tsx +4 -2
- package/src/app/[variants]/(main)/settings/hotkey/features/{HotkeySetting.tsx → Conversation.tsx} +19 -18
- package/src/app/[variants]/(main)/settings/hotkey/features/Essential.tsx +88 -0
- package/src/app/[variants]/(main)/settings/hotkey/page.tsx +8 -2
- package/src/app/[variants]/(main)/settings/llm/ProviderList/Azure/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/llm/components/ProviderModelList/ModelConfigModal/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/(detail)/azure/page.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/(detail)/azureai/page.tsx +1 -1
- package/src/app/[variants]/(main)/settings/storage/Advanced.tsx +26 -0
- package/src/app/[variants]/(main)/settings/system-agent/features/createForm.tsx +37 -22
- package/src/app/[variants]/(main)/settings/tts/features/OpenAI.tsx +20 -10
- package/src/app/[variants]/(main)/settings/tts/features/STT.tsx +20 -11
- package/src/const/settings/common.ts +2 -0
- package/src/const/settings/llm.ts +1 -1
- package/src/database/models/__tests__/aiProvider.test.ts +1 -1
- package/src/database/models/aiProvider.ts +1 -1
- package/src/features/AgentSetting/AgentTTS/index.tsx +1 -1
- package/src/features/ChatItem/index.tsx +35 -0
- package/src/features/Conversation/Error/APIKeyForm/Bedrock.tsx +1 -1
- package/src/features/Conversation/Error/APIKeyForm/index.tsx +1 -1
- package/src/features/Conversation/Error/index.tsx +1 -1
- package/src/features/Conversation/components/ChatItem/index.tsx +2 -6
- package/src/features/User/UserPanel/LangButton.tsx +1 -1
- package/src/features/User/UserPanel/ThemeButton.tsx +3 -3
- package/src/libs/{agent-runtime/AgentRuntime.test.ts → model-runtime/ModelRuntime.test.ts} +3 -3
- package/src/libs/{agent-runtime/AgentRuntime.ts → model-runtime/ModelRuntime.ts} +3 -3
- package/src/libs/{agent-runtime → model-runtime}/ai21/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/ai360/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/anthropic/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/baichuan/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/bedrock/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/cloudflare/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/deepseek/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/fireworksai/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/giteeai/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/github/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/google/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/groq/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/hunyuan/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/index.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/internlm/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/lmstudio/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/mistral/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/moonshot/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/novita/index.test.ts +3 -3
- package/src/libs/{agent-runtime → model-runtime}/ollama/index.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/openai/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/openrouter/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/perplexity/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/ppio/index.test.ts +4 -4
- package/src/libs/{agent-runtime → model-runtime}/providerTestUtils.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/qiniu/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/qwen/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/sensenova/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/siliconcloud/index.ts +1 -6
- package/src/libs/{agent-runtime → model-runtime}/spark/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/stepfun/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/taichu/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/tencentcloud/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/togetherai/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/upstage/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/utils/openaiCompatibleFactory/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/utils/openaiHelpers.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/utils/streams/ollama.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/utils/streams/openai.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/utils/streams/qwen.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/wenxin/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/xai/index.test.ts +2 -2
- package/src/libs/{agent-runtime → model-runtime}/zeroone/index.test.ts +1 -1
- package/src/libs/{agent-runtime → model-runtime}/zhipu/index.test.ts +2 -2
- package/src/libs/oidc-provider/config.ts +1 -1
- package/src/libs/trpc/client/lambda.ts +1 -1
- package/src/locales/default/setting.ts +45 -31
- package/src/server/globalConfig/_deprecated.test.ts +1 -1
- package/src/server/globalConfig/_deprecated.ts +1 -1
- package/src/server/globalConfig/genServerAiProviderConfig.ts +1 -1
- package/src/server/modules/AgentRuntime/index.test.ts +4 -4
- package/src/server/modules/AgentRuntime/index.ts +1 -1
- package/src/server/modules/AgentRuntime/trace.ts +1 -1
- package/src/server/routers/async/ragEval.ts +1 -1
- package/src/services/__tests__/_auth.test.ts +1 -1
- package/src/services/__tests__/chat.test.ts +3 -3
- package/src/services/_auth.ts +1 -1
- package/src/services/chat.ts +1 -1
- package/src/services/textToImage.ts +1 -1
- package/src/services/upload.ts +1 -1
- package/src/store/electron/initialState.ts +1 -1
- package/src/store/electron/selectors/__tests__/desktopState.test.ts +55 -0
- package/src/store/global/selectors/systemStatus.ts +2 -0
- package/src/store/user/slices/modelList/action.ts +1 -1
- package/src/store/user/slices/settings/selectors/general.test.ts +29 -1
- package/src/store/user/slices/settings/selectors/general.ts +4 -0
- package/src/types/fetch.ts +1 -1
- package/src/types/message/chat.ts +1 -1
- package/src/types/user/settings/general.ts +3 -1
- package/src/types/user/settings/modelProvider.ts +1 -1
- package/src/utils/errorResponse.test.ts +1 -1
- package/src/utils/errorResponse.ts +1 -1
- package/src/utils/fetch/fetchSSE.ts +1 -1
- package/src/utils/genUserLLMConfig.test.ts +1 -1
- package/src/utils/genUserLLMConfig.ts +1 -1
- package/src/app/[variants]/(main)/settings/common/features/Theme/index.tsx +0 -146
- /package/src/app/[variants]/(main)/settings/common/features/{Theme → Appearance}/ThemeSwatches/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/BaseAI.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/UniformRuntime/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ai21/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ai360/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/anthropic/handleAnthropicError.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/anthropic/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/azureOpenai/index.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/azureOpenai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/azureai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/baichuan/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/bedrock/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/cloudflare/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/cohere/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/deepseek/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/error.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/fireworksai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/giteeai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/github/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/google/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/groq/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/helpers/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/helpers/parseToolCalls.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/helpers/parseToolCalls.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/higress/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/huggingface/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/hunyuan/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/infiniai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/internlm/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/jina/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/lmstudio/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/minimax/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/mistral/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/moonshot/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/novita/__snapshots__/index.test.ts.snap +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/novita/fixtures/models.json +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/novita/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/novita/type.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/nvidia/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ollama/index.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ollama/type.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openai/__snapshots__/index.test.ts.snap +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openai/fixtures/openai-models.json +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openrouter/__snapshots__/index.test.ts.snap +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openrouter/fixtures/frontendModels.json +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openrouter/fixtures/models.json +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openrouter/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/openrouter/type.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/perplexity/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ppio/__snapshots__/index.test.ts.snap +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ppio/fixtures/models.json +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ppio/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/ppio/type.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/providerTestUtils.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/qiniu/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/qwen/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/runtimeMap.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/sambanova/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/search1api/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/sensenova/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/spark/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/stepfun/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/taichu/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/tencentcloud/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/togetherai/fixtures/models.json +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/togetherai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/togetherai/type.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/types/chat.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/types/embeddings.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/types/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/types/model.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/types/textToImage.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/types/tts.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/types/type.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/upstage/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/anthropicHelpers.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/anthropicHelpers.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/cloudflareHelpers.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/cloudflareHelpers.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/createError.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/debugStream.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/debugStream.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/desensitizeUrl.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/desensitizeUrl.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/handleOpenAIError.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/openaiCompatibleFactory/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/openaiHelpers.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/response.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/sensenovaHelpers.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/sensenovaHelpers.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/__snapshots__/protocol.test.ts.snap +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/anthropic.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/anthropic.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/bedrock/claude.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/bedrock/common.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/bedrock/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/bedrock/llama.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/bedrock/llama.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/google-ai.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/google-ai.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/model.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/ollama.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/openai.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/protocol.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/protocol.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/qwen.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/spark.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/spark.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/vertex-ai.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/streams/vertex-ai.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/uriParser.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/uriParser.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/usageConverter.test.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/utils/usageConverter.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/vertexai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/vllm/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/volcengine/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/wenxin/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/xai/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/xinference/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/zeroone/index.ts +0 -0
- /package/src/libs/{agent-runtime → model-runtime}/zhipu/index.ts +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeInternLMAI } from './index';
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeLMStudioAI } from './index';
|
6
6
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { Mock, afterEach, beforeEach, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeOpenAICompatibleRuntime } from '@/libs/
|
5
|
-
import { testProvider } from '@/libs/
|
4
|
+
import { LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
5
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
6
6
|
|
7
7
|
import { LobeMistralAI } from './index';
|
8
8
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeOpenAICompatibleRuntime } from '@/libs/
|
5
|
-
import { ModelProvider } from '@/libs/
|
6
|
-
import { testProvider } from '@/libs/
|
4
|
+
import { LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
5
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
6
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
7
7
|
|
8
8
|
import models from './fixtures/models.json';
|
9
9
|
import { LobeNovitaAI } from './index';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Ollama, Tool } from 'ollama/browser';
|
2
2
|
import { ClientOptions } from 'openai';
|
3
3
|
|
4
|
-
import { ModelRequestOptions, OpenAIChatMessage } from '@/libs/
|
4
|
+
import { ModelRequestOptions, OpenAIChatMessage } from '@/libs/model-runtime';
|
5
5
|
import { ChatModelCard } from '@/types/llm';
|
6
6
|
import { createErrorResponse } from '@/utils/errorResponse';
|
7
7
|
|
@@ -3,7 +3,7 @@ import OpenAI from 'openai';
|
|
3
3
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
5
|
// 引入模块以便于对函数进行spy
|
6
|
-
import { ChatStreamCallbacks, LobeOpenAICompatibleRuntime } from '@/libs/
|
6
|
+
import { ChatStreamCallbacks, LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
7
7
|
|
8
8
|
import * as debugStreamModule from '../utils/debugStream';
|
9
9
|
import officalOpenAIModels from './fixtures/openai-models.json';
|
@@ -1,8 +1,8 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeOpenAICompatibleRuntime } from '@/libs/
|
5
|
-
import { testProvider } from '@/libs/
|
4
|
+
import { LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
5
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
6
6
|
|
7
7
|
import frontendModels from './fixtures/frontendModels.json';
|
8
8
|
import models from './fixtures/models.json';
|
@@ -1,8 +1,8 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeOpenAICompatibleRuntime, ModelProvider } from '@/libs/
|
5
|
-
import { testProvider } from '@/libs/
|
4
|
+
import { LobeOpenAICompatibleRuntime, ModelProvider } from '@/libs/model-runtime';
|
5
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
6
6
|
|
7
7
|
import { LobePerplexityAI } from './index';
|
8
8
|
|
@@ -2,10 +2,10 @@
|
|
2
2
|
import OpenAI from 'openai';
|
3
3
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { LobeDeepSeekAI, LobeOpenAICompatibleRuntime } from '@/libs/
|
6
|
-
import { ModelProvider } from '@/libs/
|
7
|
-
import { AgentRuntimeErrorType } from '@/libs/
|
8
|
-
import { testProvider } from '@/libs/
|
5
|
+
import { LobeDeepSeekAI, LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
6
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
7
|
+
import { AgentRuntimeErrorType } from '@/libs/model-runtime';
|
8
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
9
9
|
|
10
10
|
import * as debugStreamModule from '../utils/debugStream';
|
11
11
|
import models from './fixtures/models.json';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import OpenAI from 'openai';
|
2
2
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeOpenAICompatibleRuntime } from '@/libs/
|
4
|
+
import { LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
5
5
|
|
6
6
|
import * as debugStreamModule from './utils/debugStream';
|
7
7
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeQiniuAI } from './index';
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeQwenAI } from './index';
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeSenseNovaAI } from './index';
|
6
6
|
|
@@ -89,12 +89,7 @@ export const LobeSiliconCloudAI = LobeOpenAICompatibleFactory({
|
|
89
89
|
'deepseek-ai/deepseek-vl',
|
90
90
|
];
|
91
91
|
|
92
|
-
const reasoningKeywords = [
|
93
|
-
'deepseek-ai/deepseek-r1',
|
94
|
-
'qwen/qvq',
|
95
|
-
'qwen/qwq',
|
96
|
-
'qwen/qwen3',
|
97
|
-
];
|
92
|
+
const reasoningKeywords = ['deepseek-ai/deepseek-r1', 'qwen/qvq', 'qwen/qwq', 'qwen/qwen3'];
|
98
93
|
|
99
94
|
const modelsPage = (await client.models.list()) as any;
|
100
95
|
const modelList: SiliconCloudModelCard[] = modelsPage.data;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeSparkAI } from './index';
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeStepfunAI } from './index';
|
6
6
|
|
@@ -7,8 +7,8 @@ import {
|
|
7
7
|
LobeMoonshotAI,
|
8
8
|
LobeOpenAICompatibleRuntime,
|
9
9
|
ModelProvider,
|
10
|
-
} from '@/libs/
|
11
|
-
import { testProvider } from '@/libs/
|
10
|
+
} from '@/libs/model-runtime';
|
11
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
12
12
|
|
13
13
|
import * as debugStreamModule from '../utils/debugStream';
|
14
14
|
import { LobeTaichuAI } from './index';
|
package/src/libs/{agent-runtime → model-runtime}/utils/openaiCompatibleFactory/index.test.ts
RENAMED
@@ -9,8 +9,8 @@ import {
|
|
9
9
|
ChatStreamPayload,
|
10
10
|
LobeOpenAICompatibleRuntime,
|
11
11
|
ModelProvider,
|
12
|
-
} from '@/libs/
|
13
|
-
import officalOpenAIModels from '@/libs/
|
12
|
+
} from '@/libs/model-runtime';
|
13
|
+
import officalOpenAIModels from '@/libs/model-runtime/openai/fixtures/openai-models.json';
|
14
14
|
import { sleep } from '@/utils/sleep';
|
15
15
|
|
16
16
|
import * as debugStreamModule from '../debugStream';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import OpenAI from 'openai';
|
2
2
|
|
3
3
|
import { disableStreamModels, systemToUserModels } from '@/const/models';
|
4
|
-
import { ChatStreamPayload, OpenAIChatMessage } from '@/libs/
|
4
|
+
import { ChatStreamPayload, OpenAIChatMessage } from '@/libs/model-runtime';
|
5
5
|
import { imageUrlToBase64 } from '@/utils/imageToBase64';
|
6
6
|
|
7
7
|
import { parseDataUri } from './uriParser';
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { describe, expect, it, vi } from 'vitest';
|
2
2
|
|
3
|
-
import { AgentRuntimeErrorType } from '@/libs/
|
3
|
+
import { AgentRuntimeErrorType } from '@/libs/model-runtime';
|
4
4
|
|
5
5
|
import { OpenAIStream } from './openai';
|
6
6
|
import { FIRST_CHUNK_ERROR_KEY } from './protocol';
|
@@ -365,7 +365,7 @@ describe('transformQwenStream', () => {
|
|
365
365
|
prompt_tokens: 100,
|
366
366
|
total_tokens: 150,
|
367
367
|
completion_tokens_details: {}, // Ensure these exist even if empty
|
368
|
-
prompt_tokens_details: {},
|
368
|
+
prompt_tokens_details: {}, // Ensure these exist even if empty
|
369
369
|
},
|
370
370
|
};
|
371
371
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeOpenAICompatibleRuntime, ModelProvider } from '@/libs/
|
5
|
-
import { testProvider } from '@/libs/
|
4
|
+
import { LobeOpenAICompatibleRuntime, ModelProvider } from '@/libs/model-runtime';
|
5
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
6
6
|
|
7
7
|
import { LobeWenxinAI } from './index';
|
8
8
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { ModelProvider } from '@/libs/
|
3
|
-
import { testProvider } from '@/libs/
|
2
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
3
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
4
4
|
|
5
5
|
import { LobeXAI } from './index';
|
6
6
|
|
@@ -2,8 +2,8 @@
|
|
2
2
|
import { OpenAI } from 'openai';
|
3
3
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { ChatStreamCallbacks, LobeOpenAI, LobeOpenAICompatibleRuntime } from '@/libs/
|
6
|
-
import * as debugStreamModule from '@/libs/
|
5
|
+
import { ChatStreamCallbacks, LobeOpenAI, LobeOpenAICompatibleRuntime } from '@/libs/model-runtime';
|
6
|
+
import * as debugStreamModule from '@/libs/model-runtime/utils/debugStream';
|
7
7
|
|
8
8
|
import { LobeZhipuAI } from './index';
|
9
9
|
|
@@ -25,7 +25,7 @@ export const defaultClients: ClientMetadata[] = [
|
|
25
25
|
'com.lobehub.lobehub-desktop-dev://auth/callback',
|
26
26
|
'com.lobehub.lobehub-desktop-nightly://auth/callback',
|
27
27
|
'com.lobehub.lobehub-desktop-beta://auth/callback',
|
28
|
-
'com.lobehub.lobehub-desktop://auth/
|
28
|
+
'com.lobehub.lobehub-desktop://auth/callback',
|
29
29
|
],
|
30
30
|
|
31
31
|
// 支持授权码获取令牌和刷新令牌
|
@@ -3,7 +3,7 @@ import { createTRPCReact } from '@trpc/react-query';
|
|
3
3
|
import superjson from 'superjson';
|
4
4
|
|
5
5
|
import { isDesktop } from '@/const/version';
|
6
|
-
import { ModelProvider } from '@/libs/
|
6
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
7
7
|
import type { LambdaRouter } from '@/server/routers/lambda';
|
8
8
|
|
9
9
|
import { ErrorResponse } from './types';
|
@@ -172,6 +172,22 @@ export default {
|
|
172
172
|
},
|
173
173
|
title: '助手信息',
|
174
174
|
},
|
175
|
+
|
176
|
+
settingAppearance: {
|
177
|
+
neutralColor: {
|
178
|
+
desc: '不同色彩倾向的灰阶自定义',
|
179
|
+
title: '中性色',
|
180
|
+
},
|
181
|
+
preview: {
|
182
|
+
title: '调色盘',
|
183
|
+
},
|
184
|
+
primaryColor: {
|
185
|
+
desc: '自定义主题色',
|
186
|
+
title: '主题色',
|
187
|
+
},
|
188
|
+
title: '应用外观',
|
189
|
+
},
|
190
|
+
|
175
191
|
settingChat: {
|
176
192
|
autoCreateTopicThreshold: {
|
177
193
|
desc: '当前消息数超过设定该值后,将自动创建话题',
|
@@ -214,6 +230,35 @@ export default {
|
|
214
230
|
submit: '更新聊天偏好',
|
215
231
|
title: '聊天设置',
|
216
232
|
},
|
233
|
+
settingChatAppearance: {
|
234
|
+
fontSize: {
|
235
|
+
desc: '聊天内容的字体大小',
|
236
|
+
marks: {
|
237
|
+
normal: '标准',
|
238
|
+
},
|
239
|
+
title: '字体大小',
|
240
|
+
},
|
241
|
+
highlighterTheme: {
|
242
|
+
title: '代码高亮主题',
|
243
|
+
},
|
244
|
+
mermaidTheme: {
|
245
|
+
title: 'Mermaid 主题',
|
246
|
+
},
|
247
|
+
title: '聊天外观',
|
248
|
+
},
|
249
|
+
settingCommon: {
|
250
|
+
lang: {
|
251
|
+
autoMode: '跟随系统',
|
252
|
+
title: '语言',
|
253
|
+
},
|
254
|
+
themeMode: {
|
255
|
+
auto: '自动',
|
256
|
+
dark: '深色',
|
257
|
+
light: '浅色',
|
258
|
+
title: '主题',
|
259
|
+
},
|
260
|
+
title: '通用设置',
|
261
|
+
},
|
217
262
|
settingModel: {
|
218
263
|
enableMaxTokens: {
|
219
264
|
title: '开启单次回复限制',
|
@@ -339,37 +384,6 @@ export default {
|
|
339
384
|
title: '语音合成声源',
|
340
385
|
},
|
341
386
|
},
|
342
|
-
settingTheme: {
|
343
|
-
avatar: {
|
344
|
-
title: '头像',
|
345
|
-
},
|
346
|
-
fontSize: {
|
347
|
-
desc: '聊天内容的字体大小',
|
348
|
-
marks: {
|
349
|
-
normal: '标准',
|
350
|
-
},
|
351
|
-
title: '字体大小',
|
352
|
-
},
|
353
|
-
lang: {
|
354
|
-
autoMode: '跟随系统',
|
355
|
-
title: '语言',
|
356
|
-
},
|
357
|
-
neutralColor: {
|
358
|
-
desc: '不同色彩倾向的灰阶自定义',
|
359
|
-
title: '中性色',
|
360
|
-
},
|
361
|
-
primaryColor: {
|
362
|
-
desc: '自定义主题色',
|
363
|
-
title: '主题色',
|
364
|
-
},
|
365
|
-
themeMode: {
|
366
|
-
auto: '自动',
|
367
|
-
dark: '深色',
|
368
|
-
light: '浅色',
|
369
|
-
title: '主题',
|
370
|
-
},
|
371
|
-
title: '主题设置',
|
372
|
-
},
|
373
387
|
storage: {
|
374
388
|
actions: {
|
375
389
|
export: {
|
@@ -3,7 +3,7 @@ import { describe, expect, it, vi } from 'vitest';
|
|
3
3
|
import { genServerLLMConfig } from './_deprecated';
|
4
4
|
|
5
5
|
// Mock ModelProvider enum
|
6
|
-
vi.mock('@/libs/
|
6
|
+
vi.mock('@/libs/model-runtime', () => ({
|
7
7
|
ModelProvider: {
|
8
8
|
Azure: 'azure',
|
9
9
|
Bedrock: 'bedrock',
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { getLLMConfig } from '@/config/llm';
|
2
2
|
import * as ProviderCards from '@/config/modelProviders';
|
3
|
-
import { ModelProvider } from '@/libs/
|
3
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
4
4
|
import { ModelProviderCard } from '@/types/llm';
|
5
5
|
import { extractEnabledModels, transformToChatModelCards } from '@/utils/_deprecated/parseModels';
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as AiModels from '@/config/aiModels';
|
2
2
|
import { getLLMConfig } from '@/config/llm';
|
3
|
-
import { ModelProvider } from '@/libs/
|
3
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
4
4
|
import { AiFullModelCard } from '@/types/aiModel';
|
5
5
|
import { ProviderConfig } from '@/types/user/settings';
|
6
6
|
import { extractEnabledModels, transformToAiChatModelList } from '@/utils/parseModels';
|
@@ -22,9 +22,9 @@ import {
|
|
22
22
|
LobeZeroOneAI,
|
23
23
|
LobeZhipuAI,
|
24
24
|
ModelProvider,
|
25
|
-
} from '@/libs/
|
26
|
-
import { AgentRuntime } from '@/libs/
|
27
|
-
import { LobeStepfunAI } from '@/libs/
|
25
|
+
} from '@/libs/model-runtime';
|
26
|
+
import { AgentRuntime } from '@/libs/model-runtime';
|
27
|
+
import { LobeStepfunAI } from '@/libs/model-runtime/stepfun';
|
28
28
|
|
29
29
|
import { initAgentRuntimeWithUserPayload } from './index';
|
30
30
|
|
@@ -60,7 +60,7 @@ vi.mock('@/config/llm', () => ({
|
|
60
60
|
|
61
61
|
/**
|
62
62
|
* Test cases for function initAgentRuntimeWithUserPayload
|
63
|
-
* this method will use AgentRuntime from `@/libs/
|
63
|
+
* this method will use AgentRuntime from `@/libs/model-runtime`
|
64
64
|
* and method `getLlmOptionsFromPayload` to initialize runtime
|
65
65
|
* with user payload. Test case below will test both the methods
|
66
66
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { getLLMConfig } from '@/config/llm';
|
2
2
|
import { JWTPayload } from '@/const/auth';
|
3
|
-
import { AgentRuntime, ModelProvider } from '@/libs/
|
3
|
+
import { AgentRuntime, ModelProvider } from '@/libs/model-runtime';
|
4
4
|
|
5
5
|
import apiKeyManager from './apiKeyManager';
|
6
6
|
|
@@ -7,7 +7,7 @@ import {
|
|
7
7
|
TracePayload,
|
8
8
|
TraceTagMap,
|
9
9
|
} from '@/const/trace';
|
10
|
-
import { ChatStreamCallbacks, ChatStreamPayload } from '@/libs/
|
10
|
+
import { ChatStreamCallbacks, ChatStreamPayload } from '@/libs/model-runtime';
|
11
11
|
import { TraceClient } from '@/libs/traces';
|
12
12
|
|
13
13
|
export interface AgentChatOptions {
|
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
EvalEvaluationModel,
|
13
13
|
EvaluationRecordModel,
|
14
14
|
} from '@/database/server/models/ragEval';
|
15
|
-
import { ModelProvider } from '@/libs/
|
15
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
16
16
|
import { asyncAuthedProcedure, asyncRouter as router } from '@/libs/trpc/async';
|
17
17
|
import { initAgentRuntimeWithUserPayload } from '@/server/modules/AgentRuntime';
|
18
18
|
import { ChunkService } from '@/server/services/chunk';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { act } from '@testing-library/react';
|
2
2
|
import { describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { ModelProvider } from '@/libs/
|
4
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
5
5
|
import { useUserStore } from '@/store/user';
|
6
6
|
import {
|
7
7
|
GlobalLLMProviderKey,
|
@@ -24,8 +24,8 @@ import {
|
|
24
24
|
LobeZeroOneAI,
|
25
25
|
LobeZhipuAI,
|
26
26
|
ModelProvider,
|
27
|
-
} from '@/libs/
|
28
|
-
import { AgentRuntime } from '@/libs/
|
27
|
+
} from '@/libs/model-runtime';
|
28
|
+
import { AgentRuntime } from '@/libs/model-runtime';
|
29
29
|
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
30
30
|
import { aiModelSelectors } from '@/store/aiInfra';
|
31
31
|
import { useToolStore } from '@/store/tool';
|
@@ -1381,7 +1381,7 @@ describe('AgentRuntimeOnClient', () => {
|
|
1381
1381
|
|
1382
1382
|
it('ZhiPu AI provider: with apiKey', async () => {
|
1383
1383
|
// Mock the generateApiToken function
|
1384
|
-
vi.mock('@/libs/
|
1384
|
+
vi.mock('@/libs/model-runtime/zhipu/authToken', () => ({
|
1385
1385
|
generateApiToken: vi
|
1386
1386
|
.fn()
|
1387
1387
|
.mockResolvedValue(
|
package/src/services/_auth.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { JWTPayload, LOBE_CHAT_AUTH_HEADER } from '@/const/auth';
|
2
2
|
import { isDeprecatedEdition } from '@/const/version';
|
3
|
-
import { ModelProvider } from '@/libs/
|
3
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
4
4
|
import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
|
5
5
|
import { useUserStore } from '@/store/user';
|
6
6
|
import { keyVaultsConfigSelectors, userProfileSelectors } from '@/store/user/selectors';
|
package/src/services/chat.ts
CHANGED
@@ -14,7 +14,7 @@ import {
|
|
14
14
|
AgentRuntimeError,
|
15
15
|
ChatCompletionErrorPayload,
|
16
16
|
ModelProvider,
|
17
|
-
} from '@/libs/
|
17
|
+
} from '@/libs/model-runtime';
|
18
18
|
import { filesPrompts } from '@/prompts/files';
|
19
19
|
import { BuiltinSystemRolePrompts } from '@/prompts/systemRole';
|
20
20
|
import { getAgentStoreState } from '@/store/agent';
|
package/src/services/upload.ts
CHANGED
@@ -3,7 +3,7 @@ import { sha256 } from 'js-sha256';
|
|
3
3
|
|
4
4
|
import { fileEnv } from '@/config/file';
|
5
5
|
import { isDesktop, isServerMode } from '@/const/version';
|
6
|
-
import { parseDataUri } from '@/libs/
|
6
|
+
import { parseDataUri } from '@/libs/model-runtime/utils/uriParser';
|
7
7
|
import { edgeClient } from '@/libs/trpc/client';
|
8
8
|
import { API_ENDPOINTS } from '@/services/_url';
|
9
9
|
import { clientS3Storage } from '@/services/file/ClientS3';
|
@@ -5,7 +5,7 @@ export type RemoteServerError = 'CONFIG_ERROR' | 'AUTH_ERROR' | 'DISCONNECT_ERRO
|
|
5
5
|
export interface ElectronState {
|
6
6
|
appState: ElectronAppState;
|
7
7
|
dataSyncConfig: DataSyncConfig;
|
8
|
-
isAppStateInit
|
8
|
+
isAppStateInit?: boolean;
|
9
9
|
isConnectingServer?: boolean;
|
10
10
|
isInitRemoteServerConfig: boolean;
|
11
11
|
isSyncActive?: boolean;
|