@lobehub/chat 1.110.3 → 1.110.5
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 +50 -0
- package/changelog/v1.json +18 -0
- package/package.json +1 -1
- package/packages/types/package.json +5 -13
- package/packages/types/src/aiProvider.ts +2 -2
- package/packages/types/src/importer.ts +4 -4
- package/packages/types/src/index.ts +3 -0
- package/packages/types/src/llm.ts +2 -2
- package/packages/types/src/rag.ts +1 -1
- package/packages/types/src/serverConfig.ts +3 -6
- package/packages/types/src/trace/action.ts +24 -1
- package/packages/types/src/trace/enum.ts +32 -0
- package/packages/types/src/trace/index.ts +1 -0
- package/packages/types/src/user/index.ts +3 -3
- package/src/app/(backend)/_deprecated/createBizOpenAI/auth.ts +1 -1
- package/src/app/(backend)/_deprecated/createBizOpenAI/createAzureOpenai.ts +1 -1
- package/src/app/(backend)/_deprecated/createBizOpenAI/createOpenai.ts +1 -1
- package/src/app/(backend)/_deprecated/createBizOpenAI/index.ts +1 -1
- 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/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/(backend)/webapi/trace/route.ts +1 -1
- package/src/app/[variants]/(main)/settings/llm/components/Checker.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/Checker.tsx +1 -1
- package/src/const/trace.ts +2 -33
- package/src/features/AgentSetting/store/action.ts +2 -2
- package/src/features/Conversation/Error/index.tsx +1 -1
- package/src/features/Portal/Artifacts/Header.tsx +1 -1
- package/src/libs/model-runtime/ModelRuntime.test.ts +1 -1
- package/src/libs/model-runtime/ModelRuntime.ts +1 -2
- package/src/libs/model-runtime/google/index.ts +8 -98
- package/src/libs/model-runtime/utils/googleErrorParser.test.ts +228 -0
- package/src/libs/model-runtime/utils/googleErrorParser.ts +228 -0
- package/src/libs/traces/event.test.ts +1 -2
- package/src/libs/traces/event.ts +1 -1
- package/src/server/modules/ModelRuntime/trace.ts +2 -6
- package/src/services/__tests__/chat.test.ts +1 -1
- package/src/services/chat.ts +1 -2
- package/src/store/chat/slices/aiChat/actions/generateAIChat.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/memory.ts +1 -1
- package/src/store/chat/slices/message/action.test.ts +1 -1
- package/src/store/chat/slices/message/action.ts +1 -2
- package/src/store/chat/slices/plugin/action.ts +1 -1
- package/src/store/chat/slices/topic/action.ts +1 -1
- package/src/store/chat/slices/translate/action.ts +1 -1
- package/src/utils/errorResponse.test.ts +1 -1
- package/src/utils/errorResponse.ts +1 -1
- package/src/utils/fetch/__tests__/parseError.test.ts +1 -1
- package/src/utils/fetch/fetchSSE.ts +1 -1
- package/src/utils/fetch/parseError.ts +1 -1
- package/packages/types/src/share.ts +0 -7
- /package/{packages/types/src → src/types}/locale.ts +0 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,56 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.110.5](https://github.com/lobehub/lobe-chat/compare/v1.110.4...v1.110.5)
|
6
|
+
|
7
|
+
<sup>Released on **2025-08-07**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Optimize Gemini error message display & Filter empty messages.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Optimize Gemini error message display & Filter empty messages, closes [#8489](https://github.com/lobehub/lobe-chat/issues/8489) ([5b409cc](https://github.com/lobehub/lobe-chat/commit/5b409cc))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
30
|
+
### [Version 1.110.4](https://github.com/lobehub/lobe-chat/compare/v1.110.3...v1.110.4)
|
31
|
+
|
32
|
+
<sup>Released on **2025-08-06**</sup>
|
33
|
+
|
34
|
+
#### ♻ Code Refactoring
|
35
|
+
|
36
|
+
- **misc**: Refactor trace type.
|
37
|
+
|
38
|
+
<br/>
|
39
|
+
|
40
|
+
<details>
|
41
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
42
|
+
|
43
|
+
#### Code refactoring
|
44
|
+
|
45
|
+
- **misc**: Refactor trace type, closes [#8699](https://github.com/lobehub/lobe-chat/issues/8699) ([4e71af7](https://github.com/lobehub/lobe-chat/commit/4e71af7))
|
46
|
+
|
47
|
+
</details>
|
48
|
+
|
49
|
+
<div align="right">
|
50
|
+
|
51
|
+
[](#readme-top)
|
52
|
+
|
53
|
+
</div>
|
54
|
+
|
5
55
|
### [Version 1.110.3](https://github.com/lobehub/lobe-chat/compare/v1.110.2...v1.110.3)
|
6
56
|
|
7
57
|
<sup>Released on **2025-08-06**</sup>
|
package/changelog/v1.json
CHANGED
@@ -1,4 +1,22 @@
|
|
1
1
|
[
|
2
|
+
{
|
3
|
+
"children": {
|
4
|
+
"fixes": [
|
5
|
+
"Optimize Gemini error message display & Filter empty messages."
|
6
|
+
]
|
7
|
+
},
|
8
|
+
"date": "2025-08-07",
|
9
|
+
"version": "1.110.5"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"children": {
|
13
|
+
"improvements": [
|
14
|
+
"Refactor trace type."
|
15
|
+
]
|
16
|
+
},
|
17
|
+
"date": "2025-08-06",
|
18
|
+
"version": "1.110.4"
|
19
|
+
},
|
2
20
|
{
|
3
21
|
"children": {
|
4
22
|
"improvements": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.110.
|
3
|
+
"version": "1.110.5",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -2,19 +2,11 @@
|
|
2
2
|
"name": "@lobechat/types",
|
3
3
|
"version": "1.0.0",
|
4
4
|
"private": true,
|
5
|
-
"
|
6
|
-
"./*": {
|
7
|
-
"types": [
|
8
|
-
"./src/*.ts",
|
9
|
-
"./src/*/index.ts"
|
10
|
-
],
|
11
|
-
"default": [
|
12
|
-
"./src/*.ts",
|
13
|
-
"./src/*/index.ts"
|
14
|
-
]
|
15
|
-
}
|
16
|
-
},
|
5
|
+
"main": "./src/index.ts",
|
17
6
|
"dependencies": {
|
18
|
-
"@
|
7
|
+
"@lobechat/web-crawler": "workspace:*",
|
8
|
+
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
9
|
+
"type-fest": "^4.41.0",
|
10
|
+
"zod": "^3.25.76"
|
19
11
|
}
|
20
12
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { z } from 'zod';
|
2
2
|
|
3
|
-
import { AiModelForSelect, EnabledAiModel, ModelSearchImplementType } from '
|
4
|
-
import { ResponseAnimation } from '
|
3
|
+
import { AiModelForSelect, EnabledAiModel, ModelSearchImplementType } from './aiModel';
|
4
|
+
import { ResponseAnimation } from './llm';
|
5
5
|
|
6
6
|
export const AiProviderSourceEnum = {
|
7
7
|
Builtin: 'builtin',
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { LobeAgentConfig } from '
|
1
|
+
import { LobeAgentConfig } from './agent';
|
2
2
|
import {
|
3
3
|
ChatMessageError,
|
4
4
|
ChatPluginPayload,
|
@@ -6,9 +6,9 @@ import {
|
|
6
6
|
ChatToolPayload,
|
7
7
|
ChatTranslate,
|
8
8
|
MessageRoleType,
|
9
|
-
} from '
|
10
|
-
import { MetaData } from '
|
11
|
-
import { SessionGroupId } from '
|
9
|
+
} from './message';
|
10
|
+
import { MetaData } from './meta';
|
11
|
+
import { SessionGroupId } from './session';
|
12
12
|
|
13
13
|
export interface ImportSession {
|
14
14
|
config: LobeAgentConfig;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ReactNode } from 'react';
|
2
2
|
|
3
|
-
import { AiModelType, ChatModelPricing } from '
|
4
|
-
import { AiProviderSettings } from '
|
3
|
+
import { AiModelType, ChatModelPricing } from './aiModel';
|
4
|
+
import { AiProviderSettings } from './aiProvider';
|
5
5
|
|
6
6
|
export type ModelPriceCurrency = 'CNY' | 'USD';
|
7
7
|
|
@@ -1,12 +1,9 @@
|
|
1
1
|
import type { PartialDeep } from 'type-fest';
|
2
2
|
|
3
3
|
import { IFeatureFlags } from '@/config/featureFlags';
|
4
|
-
|
5
|
-
import {
|
6
|
-
|
7
|
-
UserDefaultAgent,
|
8
|
-
UserSystemAgentConfig,
|
9
|
-
} from '@/types/user/settings';
|
4
|
+
|
5
|
+
import { ChatModelCard } from './llm';
|
6
|
+
import { GlobalLLMProviderKey, UserDefaultAgent, UserSystemAgentConfig } from './user/settings';
|
10
7
|
|
11
8
|
export interface ServerModelProviderConfig {
|
12
9
|
enabled?: boolean;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { TraceEventType } from '
|
1
|
+
import { TraceEventType, TraceNameMap } from './enum';
|
2
2
|
|
3
3
|
export interface TraceEventBasePayload {
|
4
4
|
content: string;
|
@@ -29,3 +29,26 @@ export type TraceEventPayloads =
|
|
29
29
|
| TraceEventModifyMessage
|
30
30
|
| TraceEventDeleteAndRegenerateMessage
|
31
31
|
| TraceEventRegenerateMessage;
|
32
|
+
|
33
|
+
export interface TracePayload {
|
34
|
+
/**
|
35
|
+
* if user allow to trace
|
36
|
+
*/
|
37
|
+
enabled?: boolean;
|
38
|
+
observationId?: string;
|
39
|
+
/**
|
40
|
+
* chat session: agentId or groupId
|
41
|
+
*/
|
42
|
+
sessionId?: string;
|
43
|
+
tags?: string[];
|
44
|
+
/**
|
45
|
+
* chat topicId
|
46
|
+
*/
|
47
|
+
topicId?: string;
|
48
|
+
traceId?: string;
|
49
|
+
traceName?: TraceNameMap;
|
50
|
+
/**
|
51
|
+
* user uuid
|
52
|
+
*/
|
53
|
+
userId?: string;
|
54
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
export enum TraceNameMap {
|
2
|
+
ConnectivityChecker = 'Connectivity Checker',
|
3
|
+
Conversation = 'Conversation',
|
4
|
+
EmojiPicker = 'Emoji Picker',
|
5
|
+
FetchPluginAPI = 'Fetch Plugin API',
|
6
|
+
LanguageDetect = 'Language Detect',
|
7
|
+
SearchIntentRecognition = 'Search Intent Recognition',
|
8
|
+
SummaryAgentDescription = 'Summary Agent Description',
|
9
|
+
SummaryAgentTags = 'Summary Agent Tags',
|
10
|
+
SummaryAgentTitle = 'Summary Agent Title',
|
11
|
+
SummaryHistoryMessages = 'Summary History Messages',
|
12
|
+
SummaryTopicTitle = 'Summary Topic Title',
|
13
|
+
Translator = 'Translator',
|
14
|
+
}
|
15
|
+
|
16
|
+
export enum TraceEventType {
|
17
|
+
CopyMessage = 'Copy Message',
|
18
|
+
DeleteAndRegenerateMessage = 'Delete And Regenerate Message',
|
19
|
+
ModifyMessage = 'Modify Message',
|
20
|
+
RegenerateMessage = 'Regenerate Message',
|
21
|
+
}
|
22
|
+
|
23
|
+
export enum TraceTopicType {
|
24
|
+
AgentSettings = 'Agent Settings',
|
25
|
+
}
|
26
|
+
|
27
|
+
export enum TraceTagMap {
|
28
|
+
Chat = 'Chat Competition',
|
29
|
+
SystemChain = 'System Chain',
|
30
|
+
ToolCalling = 'Tool Calling',
|
31
|
+
ToolsCalling = 'Tools Calling',
|
32
|
+
}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { PartialDeep } from 'type-fest';
|
2
2
|
import { z } from 'zod';
|
3
3
|
|
4
|
-
import { Plans } from '
|
5
|
-
import { TopicDisplayMode } from '
|
6
|
-
import { UserSettings } from '
|
4
|
+
import { Plans } from '../subscription';
|
5
|
+
import { TopicDisplayMode } from '../topic';
|
6
|
+
import { UserSettings } from '../user/settings';
|
7
7
|
|
8
8
|
export interface LobeUser {
|
9
9
|
avatar?: string;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// @vitest-environment node
|
2
2
|
import { getAuth } from '@clerk/nextjs/server';
|
3
|
-
import { ChatErrorType } from '@lobechat/types
|
3
|
+
import { ChatErrorType } from '@lobechat/types';
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
5
5
|
|
6
6
|
import { checkAuthMethod } from '@/app/(backend)/middleware/auth/utils';
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import { ChatErrorType, ErrorType } from '@lobechat/types
|
1
|
+
import { ChatErrorType, ErrorType , TraceNameMap } from '@lobechat/types';
|
2
2
|
import { PluginRequestPayload } from '@lobehub/chat-plugin-sdk';
|
3
3
|
import { createGatewayOnEdgeRuntime } from '@lobehub/chat-plugins-gateway';
|
4
4
|
|
5
5
|
import { LOBE_CHAT_AUTH_HEADER, OAUTH_AUTHORIZED, enableNextAuth } from '@/const/auth';
|
6
|
-
import { LOBE_CHAT_TRACE_ID
|
6
|
+
import { LOBE_CHAT_TRACE_ID } from '@/const/trace';
|
7
7
|
import { getAppConfig } from '@/envs/app';
|
8
8
|
import { AgentRuntimeError } from '@/libs/model-runtime';
|
9
9
|
import { TraceClient } from '@/libs/traces';
|
@@ -1,13 +1,13 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
3
|
import { CheckCircleFilled } from '@ant-design/icons';
|
4
|
+
import { TraceNameMap } from '@lobechat/types';
|
4
5
|
import { Alert, Button, Highlighter } from '@lobehub/ui';
|
5
6
|
import { useTheme } from 'antd-style';
|
6
7
|
import { memo, useState } from 'react';
|
7
8
|
import { useTranslation } from 'react-i18next';
|
8
9
|
import { Flexbox } from 'react-layout-kit';
|
9
10
|
|
10
|
-
import { TraceNameMap } from '@/const/trace';
|
11
11
|
import { useIsMobile } from '@/hooks/useIsMobile';
|
12
12
|
import { useProviderName } from '@/hooks/useProviderName';
|
13
13
|
import { chatService } from '@/services/chat';
|
@@ -1,6 +1,7 @@
|
|
1
1
|
'use client';
|
2
2
|
|
3
3
|
import { CheckCircleFilled } from '@ant-design/icons';
|
4
|
+
import { TraceNameMap } from '@lobechat/types';
|
4
5
|
import { ModelIcon } from '@lobehub/icons';
|
5
6
|
import { Alert, Button, Highlighter, Icon, Select } from '@lobehub/ui';
|
6
7
|
import { useTheme } from 'antd-style';
|
@@ -9,7 +10,6 @@ import { ReactNode, memo, useState } from 'react';
|
|
9
10
|
import { useTranslation } from 'react-i18next';
|
10
11
|
import { Flexbox } from 'react-layout-kit';
|
11
12
|
|
12
|
-
import { TraceNameMap } from '@/const/trace';
|
13
13
|
import { useProviderName } from '@/hooks/useProviderName';
|
14
14
|
import { chatService } from '@/services/chat';
|
15
15
|
import { aiModelSelectors, aiProviderSelectors, useAiInfraStore } from '@/store/aiInfra';
|
package/src/const/trace.ts
CHANGED
@@ -1,40 +1,9 @@
|
|
1
|
+
import { TraceNameMap } from '@/types/trace';
|
2
|
+
|
1
3
|
export const LOBE_CHAT_TRACE_HEADER = 'X-lobe-trace';
|
2
4
|
export const LOBE_CHAT_TRACE_ID = 'X-lobe-chat-trace-id';
|
3
5
|
export const LOBE_CHAT_OBSERVATION_ID = 'X-lobe-observation-id';
|
4
6
|
|
5
|
-
export enum TraceNameMap {
|
6
|
-
ConnectivityChecker = 'Connectivity Checker',
|
7
|
-
Conversation = 'Conversation',
|
8
|
-
EmojiPicker = 'Emoji Picker',
|
9
|
-
FetchPluginAPI = 'Fetch Plugin API',
|
10
|
-
LanguageDetect = 'Language Detect',
|
11
|
-
SearchIntentRecognition = 'Search Intent Recognition',
|
12
|
-
SummaryAgentDescription = 'Summary Agent Description',
|
13
|
-
SummaryAgentTags = 'Summary Agent Tags',
|
14
|
-
SummaryAgentTitle = 'Summary Agent Title',
|
15
|
-
SummaryHistoryMessages = 'Summary History Messages',
|
16
|
-
SummaryTopicTitle = 'Summary Topic Title',
|
17
|
-
Translator = 'Translator',
|
18
|
-
}
|
19
|
-
|
20
|
-
export enum TraceEventType {
|
21
|
-
CopyMessage = 'Copy Message',
|
22
|
-
DeleteAndRegenerateMessage = 'Delete And Regenerate Message',
|
23
|
-
ModifyMessage = 'Modify Message',
|
24
|
-
RegenerateMessage = 'Regenerate Message',
|
25
|
-
}
|
26
|
-
|
27
|
-
export enum TraceTopicType {
|
28
|
-
AgentSettings = 'Agent Settings',
|
29
|
-
}
|
30
|
-
|
31
|
-
export enum TraceTagMap {
|
32
|
-
Chat = 'Chat Competition',
|
33
|
-
SystemChain = 'System Chain',
|
34
|
-
ToolCalling = 'Tool Calling',
|
35
|
-
ToolsCalling = 'Tools Calling',
|
36
|
-
}
|
37
|
-
|
38
7
|
export interface TracePayload {
|
39
8
|
/**
|
40
9
|
* if user allow to trace
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import
|
1
|
+
import { TraceNameMap, TracePayload, TraceTopicType } from '@lobechat/types';
|
2
2
|
import { getSingletonAnalyticsOptional } from '@lobehub/analytics';
|
3
|
+
import type { PartialDeep } from 'type-fest';
|
3
4
|
import { StateCreator } from 'zustand/vanilla';
|
4
5
|
|
5
6
|
import { chainPickEmoji } from '@/chains/pickEmoji';
|
6
7
|
import { chainSummaryAgentName } from '@/chains/summaryAgentName';
|
7
8
|
import { chainSummaryDescription } from '@/chains/summaryDescription';
|
8
9
|
import { chainSummaryTags } from '@/chains/summaryTags';
|
9
|
-
import { TraceNameMap, TracePayload, TraceTopicType } from '@/const/trace';
|
10
10
|
import { chatService } from '@/services/chat';
|
11
11
|
import { useUserStore } from '@/store/user';
|
12
12
|
import { systemAgentSelectors } from '@/store/user/slices/settings/selectors';
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ChatErrorType, ErrorType } from '@lobechat/types
|
1
|
+
import { ChatErrorType, ErrorType } from '@lobechat/types';
|
2
2
|
import { IPluginErrorType } from '@lobehub/chat-plugin-sdk';
|
3
3
|
import type { AlertProps } from '@lobehub/ui';
|
4
4
|
import { Skeleton } from 'antd';
|
@@ -1,11 +1,11 @@
|
|
1
1
|
// @vitest-environment node
|
2
|
+
import { TraceNameMap } from '@lobechat/types';
|
2
3
|
import { Langfuse } from 'langfuse';
|
3
4
|
import { LangfuseGenerationClient, LangfuseTraceClient } from 'langfuse-core';
|
4
5
|
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
5
6
|
|
6
7
|
import * as langfuseCfg from '@/config/langfuse';
|
7
8
|
import { ClientSecretPayload } from '@/const/auth';
|
8
|
-
import { TraceNameMap } from '@/const/trace';
|
9
9
|
import { ChatStreamPayload, LobeOpenAI, ModelProvider, ModelRuntime } from '@/libs/model-runtime';
|
10
10
|
import { providerRuntimeMap } from '@/libs/model-runtime/runtimeMap';
|
11
11
|
import { CreateImagePayload } from '@/libs/model-runtime/types/image';
|
@@ -1,7 +1,6 @@
|
|
1
|
+
import type { TracePayload } from '@lobechat/types';
|
1
2
|
import { ClientOptions } from 'openai';
|
2
3
|
|
3
|
-
import type { TracePayload } from '@/const/trace';
|
4
|
-
|
5
4
|
import { LobeRuntimeAI } from './BaseAI';
|
6
5
|
import { LobeBedrockAIParams } from './bedrock';
|
7
6
|
import { LobeCloudflareParams } from './cloudflare';
|