mirror of
https://github.com/labring/FastGPT.git
synced 2026-02-28 01:02:28 +08:00
fix: surrender;perf: llm response (#6190)
* feat: workflow route to detail * llm response * fix: surrender * fix: surrender * fix: surrender * fix: test
This commit is contained in:
@@ -44,3 +44,10 @@ export function splitCombineToolId(id: string) {
|
||||
}
|
||||
return { source, pluginId: id };
|
||||
}
|
||||
|
||||
export const getToolRawId = (id: string) => {
|
||||
const toolId = splitCombineToolId(id).pluginId;
|
||||
|
||||
// 兼容 toolset
|
||||
return toolId.split('/')[0];
|
||||
};
|
||||
|
||||
30
packages/global/openapi/core/app/common/api.ts
Normal file
30
packages/global/openapi/core/app/common/api.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { ObjectIdSchema } from '../../../../common/type/mongo';
|
||||
import { z } from 'zod';
|
||||
|
||||
/* Get App Permission */
|
||||
export const GetAppPermissionQuerySchema = z.object({
|
||||
appId: ObjectIdSchema.meta({
|
||||
example: '68ad85a7463006c963799a05',
|
||||
description: '应用 ID'
|
||||
})
|
||||
});
|
||||
export type GetAppPermissionQueryType = z.infer<typeof GetAppPermissionQuerySchema>;
|
||||
|
||||
export const GetAppPermissionResponseSchema = z.object({
|
||||
hasReadPer: z.boolean().meta({
|
||||
description: '是否有读权限'
|
||||
}),
|
||||
hasWritePer: z.boolean().meta({
|
||||
description: '是否有写权限'
|
||||
}),
|
||||
hasManagePer: z.boolean().meta({
|
||||
description: '是否有管理权限'
|
||||
}),
|
||||
hasReadChatLogPer: z.boolean().meta({
|
||||
description: '是否有读取对话日志权限'
|
||||
}),
|
||||
isOwner: z.boolean().meta({
|
||||
description: '是否为所有者'
|
||||
})
|
||||
});
|
||||
export type GetAppPermissionResponseType = z.infer<typeof GetAppPermissionResponseSchema>;
|
||||
26
packages/global/openapi/core/app/common/index.ts
Normal file
26
packages/global/openapi/core/app/common/index.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { OpenAPIPath } from '../../../type';
|
||||
import { TagsMap } from '../../../tag';
|
||||
import { GetAppPermissionQuerySchema, GetAppPermissionResponseSchema } from './api';
|
||||
|
||||
export const AppCommonPath: OpenAPIPath = {
|
||||
'/core/app/getPermission': {
|
||||
get: {
|
||||
summary: '获取应用权限',
|
||||
description: '根据应用 ID 获取当前用户对该应用的权限信息',
|
||||
tags: [TagsMap.appCommon],
|
||||
requestParams: {
|
||||
query: GetAppPermissionQuerySchema
|
||||
},
|
||||
responses: {
|
||||
200: {
|
||||
description: '成功获取应用权限',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: GetAppPermissionResponseSchema
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,8 +1,10 @@
|
||||
import type { OpenAPIPath } from '../../type';
|
||||
import { AppLogPath } from './log';
|
||||
import { PublishChannelPath } from './publishChannel';
|
||||
import { AppCommonPath } from './common';
|
||||
|
||||
export const AppPath: OpenAPIPath = {
|
||||
...AppLogPath,
|
||||
...PublishChannelPath
|
||||
...PublishChannelPath,
|
||||
...AppCommonPath
|
||||
};
|
||||
|
||||
@@ -24,7 +24,7 @@ export const openAPIDocument = createDocument({
|
||||
'x-tagGroups': [
|
||||
{
|
||||
name: 'Agent 应用',
|
||||
tags: [TagsMap.appLog, TagsMap.publishChannel]
|
||||
tags: [TagsMap.appCommon, TagsMap.appLog, TagsMap.publishChannel]
|
||||
},
|
||||
{
|
||||
name: '对话管理',
|
||||
|
||||
@@ -2,6 +2,8 @@ export const TagsMap = {
|
||||
/* Core */
|
||||
// Agent - log
|
||||
appLog: 'Agent 日志',
|
||||
// Agent - common
|
||||
appCommon: 'Agent 管理',
|
||||
|
||||
// Chat - home
|
||||
chatPage: '对话页',
|
||||
|
||||
Reference in New Issue
Block a user