@lobehub/chat 1.111.6 → 1.111.7
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 +25 -0
- package/changelog/v1.json +9 -0
- package/docker-compose/local/.env.example +1 -0
- package/docker-compose/local/.env.zh-CN.example +1 -0
- package/docker-compose/local/docker-compose.yml +1 -1
- package/docker-compose/local/init_data.json +994 -488
- package/docker-compose/setup.sh +3 -3
- package/package.json +3 -3
- package/packages/model-runtime/package.json +12 -0
- package/{src/libs/model-runtime → packages/model-runtime/src}/anthropic/index.ts +8 -6
- package/{src/libs/model-runtime → packages/model-runtime/src}/google/index.ts +1 -2
- package/{src/libs/model-runtime → packages/model-runtime/src}/minimax/createImage.test.ts +12 -15
- package/{src/libs/model-runtime → packages/model-runtime/src}/minimax/createImage.ts +1 -2
- package/{src/libs/model-runtime → packages/model-runtime/src}/moonshot/index.ts +1 -1
- package/{src/libs/model-runtime → packages/model-runtime/src}/qwen/createImage.ts +5 -5
- package/{src/libs/model-runtime → packages/model-runtime/src}/qwen/index.ts +2 -2
- package/{src/libs/model-runtime → packages/model-runtime/src}/sensenova/index.ts +14 -4
- package/{src/libs/model-runtime → packages/model-runtime/src}/utils/googleErrorParser.test.ts +46 -34
- package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/openai/responsesStream.ts +14 -12
- package/{src/libs/model-runtime → packages/model-runtime/src}/utils/usageConverter.test.ts +1 -1
- package/{src/libs/model-runtime → packages/model-runtime/src}/utils/usageConverter.ts +9 -5
- package/{src/libs/model-runtime → packages/model-runtime/src}/volcengine/index.ts +4 -4
- package/src/app/(backend)/middleware/auth/index.test.ts +1 -1
- package/src/app/(backend)/middleware/auth/index.ts +5 -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 +4 -4
- package/src/app/(backend)/webapi/chat/vertexai/route.ts +2 -1
- 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 +2 -2
- package/src/app/(backend)/webapi/text-to-image/[provider]/route.ts +1 -1
- package/src/app/[variants]/(main)/settings/llm/ProviderList/Azure/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/components/InvalidAPIKey/APIKeyForm/Bedrock.tsx +1 -1
- package/src/components/InvalidAPIKey/APIKeyForm/index.tsx +1 -1
- package/src/const/settings/llm.ts +2 -1
- package/src/database/models/__tests__/aiProvider.test.ts +1 -1
- package/src/database/models/aiProvider.ts +1 -1
- package/src/features/Conversation/Error/index.tsx +1 -1
- package/src/libs/trpc/client/lambda.ts +1 -1
- package/src/server/globalConfig/_deprecated.test.ts +1 -1
- package/src/server/globalConfig/_deprecated.ts +2 -1
- package/src/server/globalConfig/genServerAiProviderConfig.test.ts +1 -1
- package/src/server/globalConfig/genServerAiProviderConfig.ts +2 -1
- package/src/server/modules/ModelRuntime/index.test.ts +10 -7
- package/src/server/modules/ModelRuntime/index.ts +2 -1
- package/src/server/modules/ModelRuntime/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 +11 -11
- package/src/services/_auth.ts +2 -1
- package/src/services/chat.ts +6 -6
- package/src/services/textToImage.ts +2 -1
- package/src/store/image/slices/generationConfig/initialState.ts +2 -1
- package/src/store/user/slices/modelList/action.ts +1 -1
- package/src/utils/errorResponse.test.ts +1 -2
- package/src/utils/errorResponse.ts +1 -2
- package/src/utils/fetch/fetchSSE.ts +1 -1
- package/src/utils/genUserLLMConfig.test.ts +1 -1
- package/src/utils/genUserLLMConfig.ts +2 -1
- package/tsconfig.json +2 -0
- package/vitest.config.ts +1 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/BaseAI.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ModelRuntime.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ModelRuntime.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/RouterRuntime/baseRuntimeMap.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/RouterRuntime/createRuntime.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/RouterRuntime/createRuntime.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/RouterRuntime/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/UniformRuntime/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ai21/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ai21/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ai302/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ai360/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ai360/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/aihubmix/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/anthropic/handleAnthropicError.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/anthropic/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/azureOpenai/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/azureOpenai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/azureai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/baichuan/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/baichuan/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/bedrock/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/bedrock/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/cloudflare/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/cloudflare/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/cohere/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/deepseek/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/deepseek/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/error.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/fal/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/fal/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/fireworksai/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/fireworksai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/giteeai/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/giteeai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/github/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/github/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/google/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/groq/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/groq/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/helpers/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/helpers/parseToolCalls.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/helpers/parseToolCalls.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/higress/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/huggingface/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/hunyuan/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/hunyuan/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/infiniai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/internlm/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/internlm/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/jina/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/lmstudio/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/lmstudio/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/minimax/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/mistral/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/mistral/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/modelscope/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/moonshot/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/novita/__snapshots__/index.test.ts.snap +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/novita/fixtures/models.json +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/novita/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/novita/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/novita/type.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/nvidia/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ollama/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ollama/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ollama/type.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openai/__snapshots__/index.test.ts.snap +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openai/fixtures/openai-models.json +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openai/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openrouter/__snapshots__/index.test.ts.snap +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openrouter/fixtures/frontendModels.json +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openrouter/fixtures/models.json +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openrouter/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openrouter/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/openrouter/type.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/perplexity/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/perplexity/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ppio/__snapshots__/index.test.ts.snap +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ppio/fixtures/models.json +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ppio/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ppio/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/ppio/type.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/providerTestUtils.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/providerTestUtils.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/qiniu/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/qiniu/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/qwen/createImage.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/qwen/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/runtimeMap.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/sambanova/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/search1api/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/sensenova/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/siliconcloud/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/spark/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/spark/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/stepfun/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/stepfun/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/taichu/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/taichu/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/tencentcloud/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/tencentcloud/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/togetherai/fixtures/models.json +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/togetherai/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/togetherai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/togetherai/type.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/chat.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/embeddings.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/image.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/model.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/textToImage.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/tts.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/types/type.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/upstage/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/upstage/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/anthropicHelpers.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/anthropicHelpers.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/cloudflareHelpers.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/cloudflareHelpers.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/createError.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/debugStream.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/debugStream.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/desensitizeUrl.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/desensitizeUrl.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/googleErrorParser.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/handleOpenAIError.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/modelParse.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/modelParse.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/openaiCompatibleFactory/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/openaiCompatibleFactory/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/openaiHelpers.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/openaiHelpers.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/response.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/sensenovaHelpers.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/sensenovaHelpers.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/__snapshots__/protocol.test.ts.snap +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/anthropic.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/anthropic.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/bedrock/claude.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/bedrock/common.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/bedrock/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/bedrock/llama.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/bedrock/llama.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/google-ai.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/google-ai.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/model.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/ollama.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/ollama.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/openai/__snapshots__/responsesStream.test.ts.snap +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/openai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/openai/openai.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/openai/openai.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/openai/responsesStream.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/protocol.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/protocol.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/qwen.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/qwen.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/spark.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/spark.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/utils.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/vertex-ai.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/streams/vertex-ai.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/uriParser.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/utils/uriParser.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/v0/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/vertexai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/vllm/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/wenxin/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/wenxin/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/xai/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/xai/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/xinference/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/zeroone/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/zeroone/index.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/zhipu/index.test.ts +0 -0
- /package/{src/libs/model-runtime → packages/model-runtime/src}/zhipu/index.ts +0 -0
@@ -1,7 +1,7 @@
|
|
1
|
+
import { ChatCompletionErrorPayload, PullModelParams } from '@lobechat/model-runtime';
|
1
2
|
import { ChatErrorType } from '@lobechat/types';
|
2
3
|
|
3
4
|
import { checkAuth } from '@/app/(backend)/middleware/auth';
|
4
|
-
import { ChatCompletionErrorPayload, PullModelParams } from '@/libs/model-runtime';
|
5
5
|
import { initModelRuntimeWithUserPayload } from '@/server/modules/ModelRuntime';
|
6
6
|
import { createErrorResponse } from '@/utils/errorResponse';
|
7
7
|
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import { ChatCompletionErrorPayload, ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { ChatErrorType } from '@lobechat/types';
|
2
3
|
import { NextResponse } from 'next/server';
|
3
4
|
|
4
5
|
import { checkAuth } from '@/app/(backend)/middleware/auth';
|
5
|
-
import { ChatCompletionErrorPayload, ModelProvider } from '@/libs/model-runtime';
|
6
6
|
import { initModelRuntimeWithUserPayload } from '@/server/modules/ModelRuntime';
|
7
7
|
import { createErrorResponse } from '@/utils/errorResponse';
|
8
8
|
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import {
|
1
|
+
import { AgentRuntimeError } from '@lobechat/model-runtime';
|
2
|
+
import { ChatErrorType, ErrorType, TraceNameMap } from '@lobechat/types';
|
2
3
|
import { PluginRequestPayload } from '@lobehub/chat-plugin-sdk';
|
3
4
|
import { createGatewayOnEdgeRuntime } from '@lobehub/chat-plugins-gateway';
|
4
5
|
|
5
6
|
import { LOBE_CHAT_AUTH_HEADER, OAUTH_AUTHORIZED, enableNextAuth } from '@/const/auth';
|
6
7
|
import { LOBE_CHAT_TRACE_ID } from '@/const/trace';
|
7
8
|
import { getAppConfig } from '@/envs/app';
|
8
|
-
import { AgentRuntimeError } from '@/libs/model-runtime';
|
9
9
|
import { TraceClient } from '@/libs/traces';
|
10
10
|
import { createErrorResponse } from '@/utils/errorResponse';
|
11
11
|
import { getXorPayload } from '@/utils/server/xor';
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import { ChatCompletionErrorPayload } from '@lobechat/model-runtime';
|
1
2
|
import { ChatErrorType } from '@lobechat/types';
|
2
3
|
import { NextResponse } from 'next/server';
|
3
4
|
|
4
5
|
import { checkAuth } from '@/app/(backend)/middleware/auth';
|
5
|
-
import { ChatCompletionErrorPayload } from '@/libs/model-runtime';
|
6
6
|
import { TextToImagePayload } from '@/libs/model-runtime/types';
|
7
7
|
import { initModelRuntimeWithUserPayload } from '@/server/modules/ModelRuntime';
|
8
8
|
import { createErrorResponse } from '@/utils/errorResponse';
|
@@ -1,11 +1,11 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
3
4
|
import { AutoComplete, Input, InputPassword, Markdown } from '@lobehub/ui';
|
4
5
|
import { createStyles } from 'antd-style';
|
5
6
|
import { useTranslation } from 'react-i18next';
|
6
7
|
|
7
8
|
import { AzureProviderCard } from '@/config/modelProviders';
|
8
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
9
9
|
import { useUserStore } from '@/store/user';
|
10
10
|
import { modelProviderSelectors } from '@/store/user/selectors';
|
11
11
|
|
@@ -1,12 +1,12 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
3
4
|
import { AutoComplete, Markdown } from '@lobehub/ui';
|
4
5
|
import { createStyles } from 'antd-style';
|
5
6
|
import { useTranslation } from 'react-i18next';
|
6
7
|
|
7
8
|
import { FormInput, FormPassword } from '@/components/FormInput';
|
8
9
|
import { AzureProviderCard } from '@/config/modelProviders';
|
9
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
10
10
|
import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
|
11
11
|
import { useUserStore } from '@/store/user';
|
12
12
|
import { modelProviderSelectors } from '@/store/user/selectors';
|
@@ -1,10 +1,10 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
3
4
|
import { useTranslation } from 'react-i18next';
|
4
5
|
|
5
6
|
import { FormInput, FormPassword } from '@/components/FormInput';
|
6
7
|
import { AzureAIProviderCard } from '@/config/modelProviders';
|
7
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
8
8
|
import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
|
9
9
|
|
10
10
|
import { KeyVaultsConfigKey, LLMProviderApiTokenKey, LLMProviderBaseUrlKey } from '../../const';
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { Aws } from '@lobehub/icons';
|
2
3
|
import { Button, Icon, InputPassword, Select } from '@lobehub/ui';
|
3
4
|
import { useTheme } from 'antd-style';
|
@@ -6,7 +7,6 @@ import { memo, useState } from 'react';
|
|
6
7
|
import { useTranslation } from 'react-i18next';
|
7
8
|
|
8
9
|
import { FormAction } from '@/features/Conversation/Error/style';
|
9
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
10
10
|
import { useUserStore } from '@/store/user';
|
11
11
|
import { keyVaultsConfigSelectors } from '@/store/user/selectors';
|
12
12
|
|
@@ -1,10 +1,10 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { ProviderIcon } from '@lobehub/icons';
|
2
3
|
import { Button } from '@lobehub/ui';
|
3
4
|
import { memo, useMemo, useState } from 'react';
|
4
5
|
import { useTranslation } from 'react-i18next';
|
5
6
|
import { Center, Flexbox } from 'react-layout-kit';
|
6
7
|
|
7
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
8
8
|
import { GlobalLLMProviderKey } from '@/types/user/settings';
|
9
9
|
|
10
10
|
import BedrockForm from './Bedrock';
|
@@ -1,9 +1,9 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
2
3
|
import { eq } from 'drizzle-orm';
|
3
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
4
5
|
|
5
6
|
import { LobeChatDatabase } from '@/database/type';
|
6
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
7
7
|
import { sleep } from '@/utils/sleep';
|
8
8
|
|
9
9
|
import { aiProviders, users } from '../../schemas';
|
@@ -1,9 +1,9 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { and, asc, desc, eq } from 'drizzle-orm';
|
2
3
|
import { isEmpty } from 'lodash-es';
|
3
4
|
|
4
5
|
import { DEFAULT_MODEL_PROVIDER_LIST } from '@/config/modelProviders';
|
5
6
|
import { LobeChatDatabase } from '@/database/type';
|
6
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
7
7
|
import {
|
8
8
|
AiProviderDetailItem,
|
9
9
|
AiProviderListItem,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { AgentRuntimeErrorType, ILobeAgentRuntimeErrorType } from '@lobechat/model-runtime';
|
1
2
|
import { ChatErrorType, ErrorType } from '@lobechat/types';
|
2
3
|
import { IPluginErrorType } from '@lobehub/chat-plugin-sdk';
|
3
4
|
import type { AlertProps } from '@lobehub/ui';
|
@@ -7,7 +8,6 @@ import { Suspense, memo, useMemo } from 'react';
|
|
7
8
|
import { useTranslation } from 'react-i18next';
|
8
9
|
|
9
10
|
import { useProviderName } from '@/hooks/useProviderName';
|
10
|
-
import { AgentRuntimeErrorType, ILobeAgentRuntimeErrorType } from '@/libs/model-runtime';
|
11
11
|
import { ChatMessage, ChatMessageError } from '@/types/message';
|
12
12
|
|
13
13
|
import ChatInvalidAPIKey from './ChatInvalidApiKey';
|
@@ -1,10 +1,10 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { createTRPCClient, httpBatchLink } from '@trpc/client';
|
2
3
|
import { createTRPCReact } from '@trpc/react-query';
|
3
4
|
import debug from 'debug';
|
4
5
|
import superjson from 'superjson';
|
5
6
|
|
6
7
|
import { isDesktop } from '@/const/version';
|
7
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
8
8
|
import type { LambdaRouter } from '@/server/routers/lambda';
|
9
9
|
|
10
10
|
import { ErrorResponse } from './types';
|
@@ -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('
|
6
|
+
vi.mock('@lobechat/model-runtime', () => ({
|
7
7
|
ModelProvider: {
|
8
8
|
Azure: 'azure',
|
9
9
|
Bedrock: 'bedrock',
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
2
|
+
|
1
3
|
import { getLLMConfig } from '@/config/llm';
|
2
4
|
import * as ProviderCards from '@/config/modelProviders';
|
3
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
4
5
|
import { ModelProviderCard } from '@/types/llm';
|
5
6
|
import { extractEnabledModels, transformToChatModelCards } from '@/utils/_deprecated/parseModels';
|
6
7
|
|
@@ -212,7 +212,7 @@ describe('genServerAiProvidersConfig Error Handling', () => {
|
|
212
212
|
}));
|
213
213
|
|
214
214
|
// Mock ModelProvider to include the missing provider
|
215
|
-
vi.doMock('
|
215
|
+
vi.doMock('@lobechat/model-runtime', () => ({
|
216
216
|
ModelProvider: {
|
217
217
|
openai: 'openai', // This exists in enum
|
218
218
|
anthropic: 'anthropic', // This exists in both enum and aiModels
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
2
|
+
|
1
3
|
import * as AiModels from '@/config/aiModels';
|
2
4
|
import { getLLMConfig } from '@/config/llm';
|
3
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
4
5
|
import { AiFullModelCard } from '@/types/aiModel';
|
5
6
|
import { ProviderConfig } from '@/types/user/settings';
|
6
7
|
import { extractEnabledModels, transformToAiModelList } from '@/utils/parseModels';
|
@@ -1,7 +1,4 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
-
import { describe, expect, it, vi } from 'vitest';
|
3
|
-
|
4
|
-
import { ClientSecretPayload } from '@/const/auth';
|
5
2
|
import {
|
6
3
|
LobeAnthropicAI,
|
7
4
|
LobeAzureOpenAI,
|
@@ -22,8 +19,11 @@ import {
|
|
22
19
|
LobeZeroOneAI,
|
23
20
|
LobeZhipuAI,
|
24
21
|
ModelProvider,
|
25
|
-
} from '
|
26
|
-
import { ModelRuntime } from '
|
22
|
+
} from '@lobechat/model-runtime';
|
23
|
+
import { ModelRuntime } from '@lobechat/model-runtime';
|
24
|
+
import { describe, expect, it, vi } from 'vitest';
|
25
|
+
|
26
|
+
import { ClientSecretPayload } from '@/const/auth';
|
27
27
|
import { LobeStepfunAI } from '@/libs/model-runtime/stepfun';
|
28
28
|
|
29
29
|
import { initModelRuntimeWithUserPayload } from './index';
|
@@ -60,14 +60,17 @@ vi.mock('@/config/llm', () => ({
|
|
60
60
|
|
61
61
|
/**
|
62
62
|
* Test cases for function initModelRuntimeWithUserPayload
|
63
|
-
* this method will use ModelRuntime from
|
63
|
+
* this method will use ModelRuntime from `@lobechat/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
|
*/
|
67
67
|
describe('initModelRuntimeWithUserPayload method', () => {
|
68
68
|
describe('should initialize with options correctly', () => {
|
69
69
|
it('OpenAI provider: with apikey and endpoint', async () => {
|
70
|
-
const jwtPayload: ClientSecretPayload = {
|
70
|
+
const jwtPayload: ClientSecretPayload = {
|
71
|
+
apiKey: 'user-openai-key',
|
72
|
+
baseURL: 'user-endpoint',
|
73
|
+
};
|
71
74
|
const runtime = await initModelRuntimeWithUserPayload(ModelProvider.OpenAI, jwtPayload);
|
72
75
|
expect(runtime).toBeInstanceOf(ModelRuntime);
|
73
76
|
expect(runtime['_runtime']).toBeInstanceOf(LobeOpenAI);
|
@@ -1,6 +1,7 @@
|
|
1
|
+
import { ModelProvider, ModelRuntime } from '@lobechat/model-runtime';
|
2
|
+
|
1
3
|
import { getLLMConfig } from '@/config/llm';
|
2
4
|
import { ClientSecretPayload } from '@/const/auth';
|
3
|
-
import { ModelProvider, ModelRuntime } from '@/libs/model-runtime';
|
4
5
|
|
5
6
|
import apiKeyManager from './apiKeyManager';
|
6
7
|
|
@@ -1,9 +1,9 @@
|
|
1
|
+
import { ChatStreamCallbacks, ChatStreamPayload } from '@lobechat/model-runtime';
|
1
2
|
import { TracePayload, TraceTagMap } from '@lobechat/types';
|
2
3
|
import { after } from 'next/server';
|
3
4
|
|
4
5
|
import { INBOX_SESSION_ID } from '@/const/session';
|
5
6
|
import { LOBE_CHAT_OBSERVATION_ID, LOBE_CHAT_TRACE_ID } from '@/const/trace';
|
6
|
-
import { ChatStreamCallbacks, ChatStreamPayload } from '@/libs/model-runtime';
|
7
7
|
import { TraceClient } from '@/libs/traces';
|
8
8
|
|
9
9
|
export interface AgentChatOptions {
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { TRPCError } from '@trpc/server';
|
2
3
|
import OpenAI from 'openai';
|
3
4
|
import { z } from 'zod';
|
@@ -12,7 +13,6 @@ import {
|
|
12
13
|
EvalEvaluationModel,
|
13
14
|
EvaluationRecordModel,
|
14
15
|
} from '@/database/server/models/ragEval';
|
15
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
16
16
|
import { asyncAuthedProcedure, asyncRouter as router } from '@/libs/trpc/async';
|
17
17
|
import { initModelRuntimeWithUserPayload } from '@/server/modules/ModelRuntime';
|
18
18
|
import { ChunkService } from '@/server/services/chunk';
|
@@ -1,7 +1,7 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { act } from '@testing-library/react';
|
2
3
|
import { describe, expect, it, vi } from 'vitest';
|
3
4
|
|
4
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
5
5
|
import { useUserStore } from '@/store/user';
|
6
6
|
import {
|
7
7
|
GlobalLLMProviderKey,
|
@@ -1,12 +1,3 @@
|
|
1
|
-
import { ChatErrorType } from '@lobechat/types';
|
2
|
-
import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
|
3
|
-
import { act } from '@testing-library/react';
|
4
|
-
import { merge } from 'lodash-es';
|
5
|
-
import OpenAI from 'openai';
|
6
|
-
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
7
|
-
|
8
|
-
import { DEFAULT_USER_AVATAR } from '@/const/meta';
|
9
|
-
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
10
1
|
import {
|
11
2
|
LobeAnthropicAI,
|
12
3
|
LobeAzureOpenAI,
|
@@ -26,8 +17,17 @@ import {
|
|
26
17
|
LobeZeroOneAI,
|
27
18
|
LobeZhipuAI,
|
28
19
|
ModelProvider,
|
29
|
-
} from '
|
30
|
-
import { ModelRuntime } from '
|
20
|
+
} from '@lobechat/model-runtime';
|
21
|
+
import { ModelRuntime } from '@lobechat/model-runtime';
|
22
|
+
import { ChatErrorType } from '@lobechat/types';
|
23
|
+
import { LobeChatPluginManifest } from '@lobehub/chat-plugin-sdk';
|
24
|
+
import { act } from '@testing-library/react';
|
25
|
+
import { merge } from 'lodash-es';
|
26
|
+
import OpenAI from 'openai';
|
27
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
28
|
+
|
29
|
+
import { DEFAULT_USER_AVATAR } from '@/const/meta';
|
30
|
+
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
31
31
|
import { agentChatConfigSelectors } from '@/store/agent/selectors';
|
32
32
|
import { aiModelSelectors } from '@/store/aiInfra';
|
33
33
|
import { useToolStore } from '@/store/tool';
|
package/src/services/_auth.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
2
|
+
|
1
3
|
import { ClientSecretPayload, LOBE_CHAT_AUTH_HEADER } from '@/const/auth';
|
2
4
|
import { isDeprecatedEdition } from '@/const/version';
|
3
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
4
5
|
import { aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
|
5
6
|
import { useUserStore } from '@/store/user';
|
6
7
|
import { keyVaultsConfigSelectors, userProfileSelectors } from '@/store/user/selectors';
|
package/src/services/chat.ts
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
import {
|
2
|
+
AgentRuntimeError,
|
3
|
+
ChatCompletionErrorPayload,
|
4
|
+
ModelProvider,
|
5
|
+
ModelRuntime,
|
6
|
+
} from '@lobechat/model-runtime';
|
1
7
|
import { ChatErrorType, TracePayload, TraceTagMap } from '@lobechat/types';
|
2
8
|
import { PluginRequestPayload, createHeadersWithPluginSettings } from '@lobehub/chat-plugin-sdk';
|
3
9
|
import { produce } from 'immer';
|
@@ -8,12 +14,6 @@ import { INBOX_GUIDE_SYSTEMROLE } from '@/const/guide';
|
|
8
14
|
import { INBOX_SESSION_ID } from '@/const/session';
|
9
15
|
import { DEFAULT_AGENT_CONFIG } from '@/const/settings';
|
10
16
|
import { isDeprecatedEdition, isDesktop, isServerMode } from '@/const/version';
|
11
|
-
import {
|
12
|
-
AgentRuntimeError,
|
13
|
-
ChatCompletionErrorPayload,
|
14
|
-
ModelProvider,
|
15
|
-
ModelRuntime,
|
16
|
-
} from '@/libs/model-runtime';
|
17
17
|
import { parseDataUri } from '@/libs/model-runtime/utils/uriParser';
|
18
18
|
import { filesPrompts } from '@/prompts/files';
|
19
19
|
import { BuiltinSystemRolePrompts } from '@/prompts/systemRole';
|
@@ -1,6 +1,7 @@
|
|
1
1
|
/* eslint-disable sort-keys-fix/sort-keys-fix, typescript-sort-keys/interface */
|
2
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
3
|
+
|
2
4
|
import { gptImage1ParamsSchema } from '@/config/aiModels/openai';
|
3
|
-
import { ModelProvider } from '@/libs/model-runtime/types/type';
|
4
5
|
import {
|
5
6
|
ModelParamsSchema,
|
6
7
|
RuntimeImageGenParams,
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
1
2
|
import { produce } from 'immer';
|
2
3
|
import useSWR, { SWRResponse } from 'swr';
|
3
4
|
import type { StateCreator } from 'zustand/vanilla';
|
4
5
|
|
5
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
6
6
|
import { UserStore } from '@/store/user';
|
7
7
|
import type { ChatModelCard, ModelProviderCard } from '@/types/llm';
|
8
8
|
import type {
|
@@ -1,8 +1,7 @@
|
|
1
|
+
import { AgentRuntimeErrorType } from '@lobechat/model-runtime';
|
1
2
|
import { ChatErrorType } from '@lobechat/types';
|
2
3
|
import { describe, expect, it, vi } from 'vitest';
|
3
4
|
|
4
|
-
import { AgentRuntimeErrorType } from '@/libs/model-runtime';
|
5
|
-
|
6
5
|
import { createErrorResponse } from './errorResponse';
|
7
6
|
|
8
7
|
describe('createErrorResponse', () => {
|
@@ -1,7 +1,6 @@
|
|
1
|
+
import { AgentRuntimeErrorType, ILobeAgentRuntimeErrorType } from '@lobechat/model-runtime';
|
1
2
|
import { ChatErrorType, ErrorResponse, ErrorType } from '@lobechat/types';
|
2
3
|
|
3
|
-
import { AgentRuntimeErrorType, ILobeAgentRuntimeErrorType } from '@/libs/model-runtime';
|
4
|
-
|
5
4
|
const getStatus = (errorType: ILobeAgentRuntimeErrorType | ErrorType) => {
|
6
5
|
// InvalidAccessCode / InvalidAzureAPIKey / InvalidOpenAIAPIKey / InvalidZhipuAPIKey ....
|
7
6
|
if (errorType.toString().includes('Invalid')) return 401;
|
@@ -1,8 +1,8 @@
|
|
1
|
+
import { parseToolCalls } from '@lobechat/model-runtime';
|
1
2
|
import { ChatErrorType } from '@lobechat/types';
|
2
3
|
|
3
4
|
import { MESSAGE_CANCEL_FLAT } from '@/const/message';
|
4
5
|
import { LOBE_CHAT_OBSERVATION_ID, LOBE_CHAT_TRACE_ID } from '@/const/trace';
|
5
|
-
import { parseToolCalls } from '@/libs/model-runtime';
|
6
6
|
import { ResponseAnimation, ResponseAnimationStyle } from '@/types/llm';
|
7
7
|
import {
|
8
8
|
ChatMessageError,
|
@@ -5,7 +5,7 @@ import { ModelProviderCard } from '@/types/llm';
|
|
5
5
|
import { genUserLLMConfig } from './genUserLLMConfig';
|
6
6
|
|
7
7
|
// Mock ModelProvider enum
|
8
|
-
vi.mock('
|
8
|
+
vi.mock('@lobechat/model-runtime', () => ({
|
9
9
|
ModelProvider: {
|
10
10
|
Ollama: 'ollama',
|
11
11
|
OpenAI: 'openai',
|
@@ -1,5 +1,6 @@
|
|
1
|
+
import { ModelProvider } from '@lobechat/model-runtime';
|
2
|
+
|
1
3
|
import * as ProviderCards from '@/config/modelProviders';
|
2
|
-
import { ModelProvider } from '@/libs/model-runtime';
|
3
4
|
import { ModelProviderCard } from '@/types/llm';
|
4
5
|
import { UserModelProviderConfig } from '@/types/user/settings';
|
5
6
|
|
package/tsconfig.json
CHANGED
@@ -18,6 +18,8 @@
|
|
18
18
|
"baseUrl": ".",
|
19
19
|
"types": ["vitest/globals", "@serwist/next/typings"],
|
20
20
|
"paths": {
|
21
|
+
"@/libs/model-runtime": ["./packages/model-runtime/src/index.ts"],
|
22
|
+
"@/libs/model-runtime/*": ["./packages/model-runtime/src/*"],
|
21
23
|
"@/types/*": ["./packages/types/src/*", "./src/types/*"],
|
22
24
|
"@/*": ["./src/*"],
|
23
25
|
"~test-utils": ["./tests/utils.tsx"]
|
package/vitest.config.ts
CHANGED
@@ -9,6 +9,7 @@ export default defineConfig({
|
|
9
9
|
test: {
|
10
10
|
alias: {
|
11
11
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
12
|
+
'@/libs/model-runtime': resolve(__dirname, './packages/model-runtime/src'),
|
12
13
|
'@/types': resolve(__dirname, './packages/types/src'),
|
13
14
|
'@': resolve(__dirname, './src'),
|
14
15
|
'~test-utils': resolve(__dirname, './tests/utils.tsx'),
|
File without changes
|
File without changes
|
File without changes
|
/package/{src/libs/model-runtime → packages/model-runtime/src}/RouterRuntime/baseRuntimeMap.ts
RENAMED
File without changes
|
/package/{src/libs/model-runtime → packages/model-runtime/src}/RouterRuntime/createRuntime.test.ts
RENAMED
File without changes
|
/package/{src/libs/model-runtime → packages/model-runtime/src}/RouterRuntime/createRuntime.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/{src/libs/model-runtime → packages/model-runtime/src}/anthropic/handleAnthropicError.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/{src/libs/model-runtime → packages/model-runtime/src}/helpers/parseToolCalls.test.ts
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|