Skip to content

Commit 0720bbe

Browse files
c121914yuI-Infonewfish-cmykshikaiwei1gaord
authored
V4.9.7 feature (#4669)
* update doc * feat: Add coupon redemption feature for team subscriptions (#4595) * feat: Add coupon redemption feature for team subscriptions - Introduced `TeamCouponSub` and `TeamCouponSchema` types - Added `redeemCoupon` API endpoint - Updated UI to include a modal for coupon redemption - Added new icon and translations for "Redeem coupon" * perf: remove field teamId * perf: use dynamic import * refactor: move to page component * perf: coupon code * perf: mcp server * perf: test * auto layout (#4634) * fix 4.9.6 (#4631) * fix debug quote list * delete next text node match * fix extract default boolean value * export latest 100 chat items * fix quote item ui * doc * fix doc * feat: auto layout * perf: auto layout * fix: auto layout null * add start node --------- Co-authored-by: heheer <[email protected]> * fix: share link (#4644) * Add workflow run duration;Get audio duration (#4645) * add duration * get audio duration * Custom config path (#4649) * feat: 通过环境变量DATA_PATH获取配置文件目录 (#4622) 通过环境变量DATA_PATH获取配置文件目录,以应对不同的部署方式的多样化需求 * feat: custom configjson path * doc --------- Co-authored-by: John Chen <[email protected]> * 程序api调用场景下,如果大量调用带有图片或视频,产生的聊天记录会导致后台mongo数据库异常。这个修改给api客户端一个禁止生成聊天记录的选项,避免这个后果。 (#3964) * update special chatId * perf: vector db rename * update operationLog (#4647) * update operationLog * combine operationLogMap * solve operationI18nLogMap bug * remoce log * feat: Rerank usage (#4654) * refresh concat when update (#4655) * fix: refresh code * perf: timer lock * Fix operationLog (#4657) * perf: http streamable mcp * add alipay (#4630) * perf: subplan ui * perf: pay code * hiden bank tip * Fix: pay error (#4665) * fix quote number (#4666) * remove log --------- Co-authored-by: a.e. <[email protected]> Co-authored-by: heheer <[email protected]> Co-authored-by: John Chen <[email protected]> Co-authored-by: gaord <[email protected]> Co-authored-by: gggaaallleee <[email protected]>
1 parent a669a60 commit 0720bbe

File tree

143 files changed

+2067
-1093
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+2067
-1093
lines changed

docSite/content/zh-cn/docs/development/upgrading/497.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,32 @@ weight: 793
99

1010
## 🚀 新增内容
1111

12+
1. MCP 工具支持 HTTP Streamable 协议。
13+
2. MCP server 支持编辑工具名,适配部分客户端不支持中文名问题。
14+
3. 工作流右键可自动对齐节点。
15+
4. 支持生产环境自定义`config.json`路径。
16+
5. API 调用,支持传递一个特殊 chatId(`NO_RECORD_HISTORIES`),使得系统不会进行历史记录存储。
17+
6. 支持 Rerank 模型按量计费。
18+
7. 套餐兑换码功能
19+
8. 支付宝支付
1220

1321
## ⚙️ 优化
1422

1523
1. Doc2x 文档解析,增加报错信息捕获,增加超时时长。
1624
2. 调整 PG vector 查询语句,强制使用向量索引。
25+
3. 对话时间统计,准确返回工作流整体运行时间。
26+
4. 从 ai_proxy 获取音频解析时长。
1727

1828
## 🐛 修复
1929

2030
1. 文件上传分块大小限制,避免超出 MongoDB 限制。
2131
2. 使用记录仪表盘,无法获取指定成员的使用统计。
2232
3. 仪表盘接口,因未考虑时区问题,统计异常。
2333
4. LLM 模型测试接口,无法测试未启用的 LLM。同时修复,模型测试接口会把模型自定义请求地址去除问题。
24-
5. 导出对话记录,限制单条对话记录消息上限 1000 组,避免导出失败。
25-
6. 工作流变量下一段文本仍是工作流变量,不触发渲染。
26-
7. 调试知识库检索模块,提示无权操作知识库。
27-
8. 文本内容提取节点,默认值赋值逻辑。
34+
5. Copy app 权限问题。
35+
6. 导出对话记录,限制单条对话记录消息上限 1000 组,避免导出失败。
36+
7. 工作流变量下一段文本仍是工作流变量,不触发渲染。
37+
8. 调试知识库检索模块,提示无权操作知识库。
38+
9. 文本内容提取节点,默认值赋值逻辑。
39+
10. 分享链接中,会强制返回嵌套应用中的引用内容。
2840

env.d.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,18 @@ declare global {
2323
FE_DOMAIN: string;
2424
FILE_DOMAIN: string;
2525
NEXT_PUBLIC_BASE_URL: string;
26-
LOG_LEVEL: string;
27-
STORE_LOG_LEVEL: string;
28-
USE_IP_LIMIT: string;
29-
WORKFLOW_MAX_RUN_TIMES: string;
30-
WORKFLOW_MAX_LOOP_TIMES: string;
31-
CHECK_INTERNAL_IP: string;
32-
CHAT_LOG_URL: string;
33-
CHAT_LOG_INTERVAL: string;
34-
CHAT_LOG_SOURCE_ID_PREFIX: string;
35-
ALLOWED_ORIGINS: string;
26+
LOG_LEVEL?: string;
27+
STORE_LOG_LEVEL?: string;
28+
USE_IP_LIMIT?: string;
29+
WORKFLOW_MAX_RUN_TIMES?: string;
30+
WORKFLOW_MAX_LOOP_TIMES?: string;
31+
CHECK_INTERNAL_IP?: string;
32+
CHAT_LOG_URL?: string;
33+
CHAT_LOG_INTERVAL?: string;
34+
CHAT_LOG_SOURCE_ID_PREFIX?: string;
35+
ALLOWED_ORIGINS?: string;
36+
SHOW_COUPON?: string;
37+
CONFIG_JSON_PATH?: string;
3638
}
3739
}
3840
}

packages/global/common/system/types/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export type FastGPTFeConfigsType = {
6060
show_team_chat?: boolean;
6161
show_compliance_copywriting?: boolean;
6262
show_aiproxy?: boolean;
63+
show_coupon?: boolean;
6364
concatMd?: string;
6465

6566
concatMd?: string;
@@ -106,6 +107,12 @@ export type FastGPTFeConfigsType = {
106107
lafEnv?: string;
107108
navbarItems?: NavbarItemType[];
108109
externalProviderWorkflowVariables?: ExternalProviderWorkflowVarType[];
110+
111+
payConfig?: {
112+
wx?: boolean;
113+
alipay?: boolean;
114+
bank?: boolean;
115+
};
109116
};
110117

111118
export type SystemEnvType = {

packages/global/core/app/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const getDefaultAppForm = (): AppSimpleEditFormType => {
2626
similarity: 0.4,
2727
limit: 3000,
2828
searchMode: DatasetSearchModeEnum.embedding,
29-
usingReRank: false,
29+
usingReRank: true,
3030
rerankModel: '',
3131
rerankWeight: 0.5,
3232
datasetSearchUsingExtensionQuery: true,

packages/global/core/chat/type.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ export type ChatItemSchema = (UserChatItemType | SystemChatItemType | AIChatItem
110110
tmbId: string;
111111
appId: string;
112112
time: Date;
113+
durationSeconds?: number;
113114
};
114115

115116
export type AdminFbkType = {
@@ -122,7 +123,6 @@ export type AdminFbkType = {
122123

123124
/* --------- chat item ---------- */
124125
export type ResponseTagItemType = {
125-
totalRunningTime?: number;
126126
totalQuoteList?: SearchDataResponseItemType[];
127127
llmModuleAccount?: number;
128128
historyPreviewLength?: number;
@@ -141,6 +141,7 @@ export type ChatSiteItemType = (UserChatItemType | SystemChatItemType | AIChatIt
141141
ttsBuffer?: Uint8Array;
142142
responseData?: ChatHistoryItemResType[];
143143
time?: Date;
144+
durationSeconds?: number;
144145
} & ChatBoxInputType &
145146
ResponseTagItemType;
146147

packages/global/core/chat/utils.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,26 +77,26 @@ export const getHistoryPreview = (
7777
});
7878
};
7979

80-
export const filterModuleTypeList: any[] = [
81-
FlowNodeTypeEnum.pluginModule,
82-
FlowNodeTypeEnum.datasetSearchNode,
83-
FlowNodeTypeEnum.tools,
84-
FlowNodeTypeEnum.pluginOutput
85-
];
86-
8780
export const filterPublicNodeResponseData = ({
8881
flowResponses = [],
8982
responseDetail = false
9083
}: {
9184
flowResponses?: ChatHistoryItemResType[];
9285
responseDetail?: boolean;
9386
}) => {
87+
const publicNodeMap: Record<string, any> = {
88+
[FlowNodeTypeEnum.pluginModule]: true,
89+
[FlowNodeTypeEnum.datasetSearchNode]: true,
90+
[FlowNodeTypeEnum.tools]: true,
91+
[FlowNodeTypeEnum.pluginOutput]: true
92+
};
93+
9494
const filedList = responseDetail
9595
? ['quoteList', 'moduleType', 'pluginOutput', 'runningTime']
9696
: ['moduleType', 'pluginOutput', 'runningTime'];
9797

9898
return flowResponses
99-
.filter((item) => filterModuleTypeList.includes(item.moduleType))
99+
.filter((item) => publicNodeMap[item.moduleType])
100100
.map((item) => {
101101
const obj: DispatchNodeResponseType = {};
102102
for (let key in item) {

packages/global/core/workflow/runtime/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { FlowNodeInputTypeEnum } from '../node/constant';
22

33
export enum SseResponseEventEnum {
44
error = 'error',
5+
workflowDuration = 'workflowDuration', // workflow duration
56
answer = 'answer', // animation stream
67
fastAnswer = 'fastAnswer', // direct answer text, not animation
78
flowNodeStatus = 'flowNodeStatus', // update node status

packages/global/core/workflow/runtime/type.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { AiChatQuoteRoleType } from '../template/system/aiChat/type';
2424
import { LafAccountType, OpenaiAccountType } from '../../../support/user/team/type';
2525
import { CompletionFinishReason } from '../../ai/type';
2626
import { WorkflowInteractiveResponseType } from '../template/system/interactive/type';
27+
import { SearchDataResponseItemType } from '../../dataset/type';
2728
export type ExternalProviderType = {
2829
openaiAccount?: OpenaiAccountType;
2930
externalWorkflowVariables?: Record<string, string>;
@@ -62,6 +63,8 @@ export type ChatDispatchProps = {
6263
workflowStreamResponse?: WorkflowResponseType;
6364
workflowDispatchDeep?: number;
6465
version?: 'v1' | 'v2';
66+
67+
responseAllData?: boolean;
6568
responseDetail?: boolean;
6669
};
6770

@@ -136,12 +139,15 @@ export type DispatchNodeResponseType = {
136139
finishReason?: CompletionFinishReason;
137140

138141
// dataset search
142+
embeddingModel?: string;
143+
embeddingTokens?: number;
139144
similarity?: number;
140145
limit?: number;
141146
searchMode?: `${DatasetSearchModeEnum}`;
142147
embeddingWeight?: number;
143148
rerankModel?: string;
144149
rerankWeight?: number;
150+
reRankInputTokens?: number;
145151
searchUsingReRank?: boolean;
146152
queryExtensionResult?: {
147153
model: string;

packages/global/support/mcp/type.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export type McpKeyType = {
99

1010
export type McpAppType = {
1111
appId: string;
12+
appName?: string;
1213
toolName: string;
13-
toolAlias?: string;
1414
description: string;
1515
};

packages/global/support/operationLog/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export enum OperationLogEventEnum {
44
JOIN_TEAM = 'JOIN_TEAM',
55
CHANGE_MEMBER_NAME = 'CHANGE_MEMBER_NAME',
66
KICK_OUT_TEAM = 'KICK_OUT_TEAM',
7+
RECOVER_TEAM_MEMBER = 'RECOVER_TEAM_MEMBER',
78
CREATE_DEPARTMENT = 'CREATE_DEPARTMENT',
89
CHANGE_DEPARTMENT = 'CHANGE_DEPARTMENT',
910
DELETE_DEPARTMENT = 'DELETE_DEPARTMENT',

0 commit comments

Comments
 (0)