@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,11 +1,12 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
-
import { Button, Form, type FormGroupItemType, type FormItemProps } from '@lobehub/ui';
|
4
|
-
import { Form as AntForm, Switch } from 'antd';
|
3
|
+
import { Button, Form, type FormGroupItemType, type FormItemProps, Icon } from '@lobehub/ui';
|
4
|
+
import { Form as AntForm, Skeleton, Switch } from 'antd';
|
5
5
|
import isEqual from 'fast-deep-equal';
|
6
|
-
import { PencilIcon } from 'lucide-react';
|
7
|
-
import { memo } from 'react';
|
6
|
+
import { Loader2Icon, PencilIcon } from 'lucide-react';
|
7
|
+
import { memo, useState } from 'react';
|
8
8
|
import { useTranslation } from 'react-i18next';
|
9
|
+
import { Flexbox } from 'react-layout-kit';
|
9
10
|
|
10
11
|
import TextArea from '@/components/TextArea';
|
11
12
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
@@ -14,8 +15,6 @@ import { useUserStore } from '@/store/user';
|
|
14
15
|
import { settingsSelectors } from '@/store/user/selectors';
|
15
16
|
import { type UserSystemAgentConfigKey } from '@/types/user/settings';
|
16
17
|
|
17
|
-
import { useSyncSystemAgent } from './useSync';
|
18
|
-
|
19
18
|
interface SystemAgentFormProps {
|
20
19
|
allowCustomPrompt?: boolean;
|
21
20
|
allowDisable?: boolean;
|
@@ -26,11 +25,16 @@ interface SystemAgentFormProps {
|
|
26
25
|
const SystemAgentForm = memo(
|
27
26
|
({ systemAgentKey, allowDisable, allowCustomPrompt, defaultPrompt }: SystemAgentFormProps) => {
|
28
27
|
const { t } = useTranslation('setting');
|
29
|
-
|
28
|
+
const [form] = AntForm.useForm();
|
30
29
|
const settings = useUserStore(settingsSelectors.currentSystemAgent, isEqual);
|
31
|
-
const [updateSystemAgent] = useUserStore((s) => [
|
30
|
+
const [updateSystemAgent, isUserStateInit] = useUserStore((s) => [
|
31
|
+
s.updateSystemAgent,
|
32
|
+
s.isUserStateInit,
|
33
|
+
]);
|
34
|
+
const [loading, setLoading] = useState(false);
|
35
|
+
|
36
|
+
if (!isUserStateInit) return <Skeleton active paragraph={{ rows: 5 }} title={false} />;
|
32
37
|
|
33
|
-
const [form] = AntForm.useForm();
|
34
38
|
const value = settings[systemAgentKey];
|
35
39
|
|
36
40
|
const systemAgentSettings: FormGroupItemType = {
|
@@ -38,8 +42,10 @@ const SystemAgentForm = memo(
|
|
38
42
|
{
|
39
43
|
children: (
|
40
44
|
<ModelSelect
|
41
|
-
onChange={(props) => {
|
42
|
-
|
45
|
+
onChange={async (props) => {
|
46
|
+
setLoading(true);
|
47
|
+
await updateSystemAgent(systemAgentKey, props);
|
48
|
+
setLoading(false);
|
43
49
|
}}
|
44
50
|
showAbility={false}
|
45
51
|
// value={value}
|
@@ -52,8 +58,10 @@ const SystemAgentForm = memo(
|
|
52
58
|
(!!allowCustomPrompt && {
|
53
59
|
children: !!value.customPrompt ? (
|
54
60
|
<TextArea
|
55
|
-
|
56
|
-
|
61
|
+
onBlur={async (e) => {
|
62
|
+
setLoading(true);
|
63
|
+
await updateSystemAgent(systemAgentKey, { customPrompt: e.target.value });
|
64
|
+
setLoading(false);
|
57
65
|
}}
|
58
66
|
placeholder={t('systemAgent.customPrompt.placeholder')}
|
59
67
|
style={{ minHeight: 160 }}
|
@@ -64,7 +72,9 @@ const SystemAgentForm = memo(
|
|
64
72
|
block
|
65
73
|
icon={PencilIcon}
|
66
74
|
onClick={async () => {
|
75
|
+
setLoading(true);
|
67
76
|
await updateSystemAgent(systemAgentKey, { customPrompt: defaultPrompt });
|
77
|
+
setLoading(false);
|
68
78
|
}}
|
69
79
|
>
|
70
80
|
{t('systemAgent.customPrompt.addPrompt')}
|
@@ -75,13 +85,20 @@ const SystemAgentForm = memo(
|
|
75
85
|
name: [systemAgentKey, 'customPrompt'],
|
76
86
|
}) as FormItemProps,
|
77
87
|
].filter(Boolean),
|
78
|
-
extra:
|
79
|
-
<
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
88
|
+
extra: (
|
89
|
+
<Flexbox>
|
90
|
+
{loading && <Icon icon={Loader2Icon} size={16} spin style={{ opacity: 0.5 }} />}
|
91
|
+
{allowDisable && (
|
92
|
+
<Switch
|
93
|
+
onChange={async (enabled) => {
|
94
|
+
setLoading(true);
|
95
|
+
await updateSystemAgent(systemAgentKey, { enabled });
|
96
|
+
setLoading(false);
|
97
|
+
}}
|
98
|
+
value={value.enabled}
|
99
|
+
/>
|
100
|
+
)}
|
101
|
+
</Flexbox>
|
85
102
|
),
|
86
103
|
title: (
|
87
104
|
<span
|
@@ -94,8 +111,6 @@ const SystemAgentForm = memo(
|
|
94
111
|
),
|
95
112
|
};
|
96
113
|
|
97
|
-
useSyncSystemAgent(form, settings);
|
98
|
-
|
99
114
|
return (
|
100
115
|
<Form form={form} initialValues={settings} items={[systemAgentSettings]} {...FORM_STYLE} />
|
101
116
|
);
|
@@ -1,9 +1,11 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
-
import { Form, type FormGroupItemType } from '@lobehub/ui';
|
3
|
+
import { Form, type FormGroupItemType, Icon } from '@lobehub/ui';
|
4
4
|
import { Select } from '@lobehub/ui';
|
5
|
+
import { Skeleton } from 'antd';
|
5
6
|
import isEqual from 'fast-deep-equal';
|
6
|
-
import {
|
7
|
+
import { Loader2Icon } from 'lucide-react';
|
8
|
+
import { memo, useState } from 'react';
|
7
9
|
import { useTranslation } from 'react-i18next';
|
8
10
|
|
9
11
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
@@ -12,37 +14,45 @@ import { settingsSelectors } from '@/store/user/selectors';
|
|
12
14
|
|
13
15
|
import { opeanaiSTTOptions, opeanaiTTSOptions } from './const';
|
14
16
|
|
15
|
-
const TTS_SETTING_KEY = 'tts';
|
16
|
-
|
17
17
|
const OpenAI = memo(() => {
|
18
18
|
const { t } = useTranslation('setting');
|
19
19
|
const [form] = Form.useForm();
|
20
|
-
const
|
21
|
-
const [setSettings] = useUserStore((s) => [s.setSettings]);
|
20
|
+
const { tts } = useUserStore(settingsSelectors.currentSettings, isEqual);
|
21
|
+
const [setSettings, isUserStateInit] = useUserStore((s) => [s.setSettings, s.isUserStateInit]);
|
22
|
+
const [loading, setLoading] = useState(false);
|
23
|
+
|
24
|
+
if (!isUserStateInit) return <Skeleton active paragraph={{ rows: 5 }} title={false} />;
|
22
25
|
|
23
26
|
const openai: FormGroupItemType = {
|
24
27
|
children: [
|
25
28
|
{
|
26
29
|
children: <Select options={opeanaiTTSOptions} />,
|
27
30
|
label: t('settingTTS.openai.ttsModel'),
|
28
|
-
name: [
|
31
|
+
name: ['openAI', 'ttsModel'],
|
29
32
|
},
|
30
33
|
{
|
31
34
|
children: <Select options={opeanaiSTTOptions} />,
|
32
35
|
label: t('settingTTS.openai.sttModel'),
|
33
|
-
name: [
|
36
|
+
name: ['openAI', 'sttModel'],
|
34
37
|
},
|
35
38
|
],
|
39
|
+
extra: loading && <Icon icon={Loader2Icon} size={16} spin style={{ opacity: 0.5 }} />,
|
36
40
|
title: t('settingTTS.openai.title'),
|
37
41
|
};
|
38
42
|
|
39
43
|
return (
|
40
44
|
<Form
|
41
45
|
form={form}
|
42
|
-
initialValues={
|
46
|
+
initialValues={tts}
|
43
47
|
items={[openai]}
|
44
48
|
itemsType={'group'}
|
45
|
-
onValuesChange={
|
49
|
+
onValuesChange={async (values) => {
|
50
|
+
setLoading(true);
|
51
|
+
await setSettings({
|
52
|
+
tts: values,
|
53
|
+
});
|
54
|
+
setLoading(false);
|
55
|
+
}}
|
46
56
|
variant={'borderless'}
|
47
57
|
{...FORM_STYLE}
|
48
58
|
/>
|
@@ -1,9 +1,10 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
-
import { Form, type FormGroupItemType, Select } from '@lobehub/ui';
|
4
|
-
import { Switch } from 'antd';
|
3
|
+
import { Form, type FormGroupItemType, Icon, Select } from '@lobehub/ui';
|
4
|
+
import { Skeleton, Switch } from 'antd';
|
5
5
|
import isEqual from 'fast-deep-equal';
|
6
|
-
import {
|
6
|
+
import { Loader2Icon } from 'lucide-react';
|
7
|
+
import { memo, useState } from 'react';
|
7
8
|
import { useTranslation } from 'react-i18next';
|
8
9
|
|
9
10
|
import { FORM_STYLE } from '@/const/layoutTokens';
|
@@ -12,13 +13,14 @@ import { settingsSelectors } from '@/store/user/selectors';
|
|
12
13
|
|
13
14
|
import { sttOptions } from './const';
|
14
15
|
|
15
|
-
const TTS_SETTING_KEY = 'tts';
|
16
|
-
|
17
16
|
const STT = memo(() => {
|
18
17
|
const { t } = useTranslation('setting');
|
19
18
|
const [form] = Form.useForm();
|
20
|
-
const
|
21
|
-
const [setSettings] = useUserStore((s) => [s.setSettings]);
|
19
|
+
const { tts } = useUserStore(settingsSelectors.currentSettings, isEqual);
|
20
|
+
const [setSettings, isUserStateInit] = useUserStore((s) => [s.setSettings, s.isUserStateInit]);
|
21
|
+
const [loading, setLoading] = useState(false);
|
22
|
+
|
23
|
+
if (!isUserStateInit) return <Skeleton active paragraph={{ rows: 5 }} title={false} />;
|
22
24
|
|
23
25
|
const stt: FormGroupItemType = {
|
24
26
|
children: [
|
@@ -26,7 +28,7 @@ const STT = memo(() => {
|
|
26
28
|
children: <Select options={sttOptions} />,
|
27
29
|
desc: t('settingTTS.sttService.desc'),
|
28
30
|
label: t('settingTTS.sttService.title'),
|
29
|
-
name:
|
31
|
+
name: 'sttServer',
|
30
32
|
},
|
31
33
|
{
|
32
34
|
children: <Switch />,
|
@@ -34,20 +36,27 @@ const STT = memo(() => {
|
|
34
36
|
label: t('settingTTS.sttAutoStop.title'),
|
35
37
|
layout: 'horizontal',
|
36
38
|
minWidth: undefined,
|
37
|
-
name:
|
39
|
+
name: 'sttAutoStop',
|
38
40
|
valuePropName: 'checked',
|
39
41
|
},
|
40
42
|
],
|
43
|
+
extra: loading && <Icon icon={Loader2Icon} size={16} spin style={{ opacity: 0.5 }} />,
|
41
44
|
title: t('settingTTS.stt'),
|
42
45
|
};
|
43
46
|
|
44
47
|
return (
|
45
48
|
<Form
|
46
49
|
form={form}
|
47
|
-
initialValues={
|
50
|
+
initialValues={tts}
|
48
51
|
items={[stt]}
|
49
52
|
itemsType={'group'}
|
50
|
-
onValuesChange={
|
53
|
+
onValuesChange={async (values) => {
|
54
|
+
setLoading(true);
|
55
|
+
await setSettings({
|
56
|
+
tts: values,
|
57
|
+
});
|
58
|
+
setLoading(false);
|
59
|
+
}}
|
51
60
|
variant={'borderless'}
|
52
61
|
{...FORM_STYLE}
|
53
62
|
/>
|
@@ -3,7 +3,7 @@ import { eq } from 'drizzle-orm/expressions';
|
|
3
3
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
5
|
import { LobeChatDatabase } from '@/database/type';
|
6
|
-
import { ModelProvider } from '@/libs/
|
6
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
7
7
|
import { sleep } from '@/utils/sleep';
|
8
8
|
|
9
9
|
import { aiProviders, users } from '../../schemas';
|
@@ -3,7 +3,7 @@ import { isEmpty } from 'lodash-es';
|
|
3
3
|
|
4
4
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
5
5
|
import { LobeChatDatabase } from '@/database/type';
|
6
|
-
import { ModelProvider } from '@/libs/
|
6
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
7
7
|
import {
|
8
8
|
AiProviderDetailItem,
|
9
9
|
AiProviderListItem,
|
@@ -0,0 +1,35 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { ChatItemProps, ChatItem as ChatItemRaw } from '@lobehub/ui/chat';
|
4
|
+
import isEqual from 'fast-deep-equal';
|
5
|
+
import { memo } from 'react';
|
6
|
+
|
7
|
+
import { useUserStore } from '@/store/user';
|
8
|
+
import { settingsSelectors } from '@/store/user/selectors';
|
9
|
+
|
10
|
+
const ChatItem = memo<ChatItemProps>(({ markdownProps = {}, ...rest }) => {
|
11
|
+
const { componentProps, ...restMarkdown } = markdownProps;
|
12
|
+
const { general } = useUserStore(settingsSelectors.currentSettings, isEqual);
|
13
|
+
return (
|
14
|
+
<ChatItemRaw
|
15
|
+
fontSize={general.fontSize}
|
16
|
+
markdownProps={{
|
17
|
+
...restMarkdown,
|
18
|
+
componentProps: {
|
19
|
+
...componentProps,
|
20
|
+
highlight: {
|
21
|
+
theme: general.highlighterTheme,
|
22
|
+
...componentProps?.highlight,
|
23
|
+
},
|
24
|
+
mermaid: {
|
25
|
+
theme: general.mermaidTheme,
|
26
|
+
...componentProps?.mermaid,
|
27
|
+
},
|
28
|
+
},
|
29
|
+
}}
|
30
|
+
{...rest}
|
31
|
+
/>
|
32
|
+
);
|
33
|
+
});
|
34
|
+
|
35
|
+
export default ChatItem;
|
@@ -5,7 +5,7 @@ import { Network, ShieldPlus } from 'lucide-react';
|
|
5
5
|
import { memo, useState } from 'react';
|
6
6
|
import { useTranslation } from 'react-i18next';
|
7
7
|
|
8
|
-
import { ModelProvider } from '@/libs/
|
8
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
9
9
|
import { useUserStore } from '@/store/user';
|
10
10
|
import { keyVaultsConfigSelectors } from '@/store/user/selectors';
|
11
11
|
|
@@ -4,7 +4,7 @@ import { memo, useMemo, useState } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
5
5
|
import { Center, Flexbox } from 'react-layout-kit';
|
6
6
|
|
7
|
-
import { ModelProvider } from '@/libs/
|
7
|
+
import { ModelProvider } from '@/libs/model-runtime';
|
8
8
|
import { useChatStore } from '@/store/chat';
|
9
9
|
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
10
10
|
|
@@ -6,7 +6,7 @@ import { Suspense, memo, useMemo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
7
7
|
|
8
8
|
import { useProviderName } from '@/hooks/useProviderName';
|
9
|
-
import { AgentRuntimeErrorType, ILobeAgentRuntimeErrorType } from '@/libs/
|
9
|
+
import { AgentRuntimeErrorType, ILobeAgentRuntimeErrorType } from '@/libs/model-runtime';
|
10
10
|
import { ChatErrorType, ErrorType } from '@/types/fetch';
|
11
11
|
import { ChatMessage, ChatMessageError } from '@/types/message';
|
12
12
|
|
@@ -1,19 +1,17 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
-
import { ChatItem } from '@lobehub/ui/chat';
|
4
3
|
import { createStyles } from 'antd-style';
|
5
4
|
import isEqual from 'fast-deep-equal';
|
6
5
|
import { MouseEventHandler, ReactNode, memo, use, useCallback, useMemo } from 'react';
|
7
6
|
import { useTranslation } from 'react-i18next';
|
8
7
|
import { Flexbox } from 'react-layout-kit';
|
9
8
|
|
9
|
+
import ChatItem from '@/features/ChatItem';
|
10
10
|
import { VirtuosoContext } from '@/features/Conversation/components/VirtualizedList/VirtuosoContext';
|
11
11
|
import { useAgentStore } from '@/store/agent';
|
12
12
|
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
13
13
|
import { useChatStore } from '@/store/chat';
|
14
14
|
import { chatSelectors } from '@/store/chat/selectors';
|
15
|
-
import { useUserStore } from '@/store/user';
|
16
|
-
import { userGeneralSettingsSelectors } from '@/store/user/selectors';
|
17
15
|
import { ChatMessage } from '@/types/message';
|
18
16
|
|
19
17
|
import ErrorMessageExtra, { useErrorContent } from '../../Error';
|
@@ -72,7 +70,6 @@ const Item = memo<ChatListItemProps>(
|
|
72
70
|
|
73
71
|
const type = useAgentStore(agentChatConfigSelectors.displayMode);
|
74
72
|
const item = useChatStore(chatSelectors.getMessageById(id), isEqual);
|
75
|
-
const fontSize = useUserStore(userGeneralSettingsSelectors.fontSize);
|
76
73
|
|
77
74
|
const [
|
78
75
|
isMessageLoading,
|
@@ -178,7 +175,7 @@ const Item = memo<ChatListItemProps>(
|
|
178
175
|
enableCustomFootnotes: item?.role === 'assistant',
|
179
176
|
rehypePlugins: item?.role === 'user' ? undefined : rehypePlugins,
|
180
177
|
remarkPlugins: item?.role === 'user' ? undefined : remarkPlugins,
|
181
|
-
|
178
|
+
showFootnotes:
|
182
179
|
item?.role === 'user'
|
183
180
|
? undefined
|
184
181
|
: item?.search?.citations &&
|
@@ -235,7 +232,6 @@ const Item = memo<ChatListItemProps>(
|
|
235
232
|
editing={editing}
|
236
233
|
error={error}
|
237
234
|
errorMessage={errorMessage}
|
238
|
-
fontSize={fontSize}
|
239
235
|
loading={isProcessing}
|
240
236
|
markdownProps={markdownProps}
|
241
237
|
message={message}
|
@@ -26,7 +26,7 @@ const LangButton = memo<{ placement?: PopoverProps['placement'] }>(({ placement
|
|
26
26
|
() => [
|
27
27
|
{
|
28
28
|
key: 'auto',
|
29
|
-
label: t('
|
29
|
+
label: t('settingCommon.lang.autoMode'),
|
30
30
|
onClick: () => handleLangChange('auto'),
|
31
31
|
},
|
32
32
|
...localeOptions.map((item) => ({
|
@@ -27,19 +27,19 @@ const ThemeButton = memo<{ placement?: PopoverProps['placement'] }>(({ placement
|
|
27
27
|
{
|
28
28
|
icon: <Icon icon={themeIcons.auto} />,
|
29
29
|
key: 'auto',
|
30
|
-
label: t('
|
30
|
+
label: t('settingCommon.themeMode.auto'),
|
31
31
|
onClick: () => switchThemeMode('auto'),
|
32
32
|
},
|
33
33
|
{
|
34
34
|
icon: <Icon icon={themeIcons.light} />,
|
35
35
|
key: 'light',
|
36
|
-
label: t('
|
36
|
+
label: t('settingCommon.themeMode.light'),
|
37
37
|
onClick: () => switchThemeMode('light'),
|
38
38
|
},
|
39
39
|
{
|
40
40
|
icon: <Icon icon={themeIcons.dark} />,
|
41
41
|
key: 'dark',
|
42
|
-
label: t('
|
42
|
+
label: t('settingCommon.themeMode.dark'),
|
43
43
|
onClick: () => switchThemeMode('dark'),
|
44
44
|
},
|
45
45
|
],
|
@@ -6,11 +6,11 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
6
6
|
import * as langfuseCfg from '@/config/langfuse';
|
7
7
|
import { JWTPayload } from '@/const/auth';
|
8
8
|
import { TraceNameMap } from '@/const/trace';
|
9
|
-
import { AgentRuntime, ChatStreamPayload, LobeOpenAI, ModelProvider } from '@/libs/
|
10
|
-
import { providerRuntimeMap } from '@/libs/
|
9
|
+
import { AgentRuntime, ChatStreamPayload, LobeOpenAI, ModelProvider } from '@/libs/model-runtime';
|
10
|
+
import { providerRuntimeMap } from '@/libs/model-runtime/runtimeMap';
|
11
11
|
import { createTraceOptions } from '@/server/modules/AgentRuntime';
|
12
12
|
|
13
|
-
import { AgentChatOptions } from './
|
13
|
+
import { AgentChatOptions } from './ModelRuntime';
|
14
14
|
|
15
15
|
const specialProviders = [
|
16
16
|
{ id: 'openai', payload: { apiKey: 'user-openai-key', baseURL: 'user-endpoint' } },
|
@@ -24,7 +24,7 @@ export interface AgentChatOptions {
|
|
24
24
|
trace?: TracePayload;
|
25
25
|
}
|
26
26
|
|
27
|
-
class
|
27
|
+
class ModelRuntime {
|
28
28
|
private _runtime: LobeRuntimeAI;
|
29
29
|
|
30
30
|
constructor(runtime: LobeRuntimeAI) {
|
@@ -110,8 +110,8 @@ class AgentRuntime {
|
|
110
110
|
const providerAI = providerRuntimeMap[provider] ?? LobeOpenAI;
|
111
111
|
const runtimeModel: LobeRuntimeAI = new providerAI(params);
|
112
112
|
|
113
|
-
return new
|
113
|
+
return new ModelRuntime(runtimeModel);
|
114
114
|
}
|
115
115
|
}
|
116
116
|
|
117
|
-
export default
|
117
|
+
export default ModelRuntime;
|
@@ -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 { LobeAi21AI } 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 { LobeAi360AI } from './index';
|
6
6
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { ChatCompletionTool, ChatStreamPayload } from '@/libs/
|
4
|
+
import { ChatCompletionTool, ChatStreamPayload } from '@/libs/model-runtime';
|
5
5
|
|
6
6
|
import * as anthropicHelpers from '../utils/anthropicHelpers';
|
7
7
|
import * as debugStreamModule from '../utils/debugStream';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { Mock } from 'vitest';
|
3
3
|
|
4
|
-
import { LobeOpenAICompatibleRuntime, ModelProvider } from '@/libs/
|
4
|
+
import { LobeOpenAICompatibleRuntime, ModelProvider } from '@/libs/model-runtime';
|
5
5
|
|
6
6
|
import { testProvider } from '../providerTestUtils';
|
7
7
|
import { LobeBaichuanAI } from './index';
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { InvokeModelWithResponseStreamCommand } from '@aws-sdk/client-bedrock-runtime';
|
3
3
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
4
|
|
5
|
-
import { AgentRuntimeErrorType, ModelProvider } from '@/libs/
|
5
|
+
import { AgentRuntimeErrorType, ModelProvider } from '@/libs/model-runtime';
|
6
6
|
|
7
7
|
import * as debugStreamModule from '../utils/debugStream';
|
8
8
|
import { LobeBedrockAI } from './index';
|
@@ -1,7 +1,7 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { Mock, afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
3
3
|
|
4
|
-
import { ChatCompletionTool } from '@/libs/
|
4
|
+
import { ChatCompletionTool } from '@/libs/model-runtime';
|
5
5
|
|
6
6
|
import * as debugStreamModule from '../utils/debugStream';
|
7
7
|
import { LobeCloudflareAI } from './index';
|
@@ -6,8 +6,8 @@ import {
|
|
6
6
|
LLMRoleType,
|
7
7
|
LobeOpenAICompatibleRuntime,
|
8
8
|
ModelProvider,
|
9
|
-
} from '@/libs/
|
10
|
-
import { testProvider } from '@/libs/
|
9
|
+
} from '@/libs/model-runtime';
|
10
|
+
import { testProvider } from '@/libs/model-runtime/providerTestUtils';
|
11
11
|
|
12
12
|
import { LobeDeepSeekAI } from './index';
|
13
13
|
|
@@ -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 { LobeFireworksAI } 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 { LobeGiteeAI } 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 { LobeGithubAI } from './index';
|
6
6
|
|
@@ -3,7 +3,7 @@ import { FunctionDeclarationsTool } from '@google/generative-ai';
|
|
3
3
|
import OpenAI from 'openai';
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
5
5
|
|
6
|
-
import { OpenAIChatMessage } from '@/libs/
|
6
|
+
import { OpenAIChatMessage } from '@/libs/model-runtime';
|
7
7
|
import * as imageToBase64Module from '@/utils/imageToBase64';
|
8
8
|
|
9
9
|
import * as debugStreamModule from '../utils/debugStream';
|
@@ -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 } 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 { LobeGroq } from './index';
|
8
8
|
|
@@ -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 { LobeHunyuanAI } from './index';
|
8
8
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
export { default as AgentRuntime } from './AgentRuntime';
|
2
1
|
export { LobeAnthropicAI } from './anthropic';
|
3
2
|
export { LobeAzureAI } from './azureai';
|
4
3
|
export { LobeAzureOpenAI } from './azureOpenai';
|
@@ -11,6 +10,7 @@ export { LobeGroq } from './groq';
|
|
11
10
|
export * from './helpers';
|
12
11
|
export { LobeMinimaxAI } from './minimax';
|
13
12
|
export { LobeMistralAI } from './mistral';
|
13
|
+
export { default as AgentRuntime } from './ModelRuntime';
|
14
14
|
export { LobeMoonshotAI } from './moonshot';
|
15
15
|
export { LobeOllamaAI } from './ollama';
|
16
16
|
export { LobeOpenAI } from './openai';
|