Commit 1127c1cf by Finley Ge Committed by GitHub

perf: tool invoke log (#7061)

* fix: workflow system tool use pluginModule

* fix: zip upload cancel && bump plugin sdk version

* pref(tool):invoke tool log
parent 8c6ddb46
......@@ -22,6 +22,7 @@ import type { RequireOnlyOne } from '@fastgpt/global/common/type/utils';
import { pluginClient } from '../../../../../../../thirdProvider/fastgptPlugin';
import { SystemToolRepo } from '../../../../../../app/tool/systemTool/systemTool.repo';
import { InvokeProcessor } from '../../../../../../../support/invoke/invoke';
import { getLogger, LogCategories } from '../../../../../../../common/logger';
type SystemInputConfigType = {
type: SystemToolSecretInputTypeEnum;
......@@ -81,6 +82,8 @@ export const dispatchTool = async ({
};
};
const logger = getLogger(LogCategories.MODULE.APP.TOOL);
try {
if (toolConfig?.systemTool?.toolId) {
const systemToolRepo = SystemToolRepo.getInstance();
......@@ -152,6 +155,7 @@ export const dispatchTool = async ({
const result: any = res.output || {};
if (res.error) {
logger.error('Call tool error', { error: res.error });
return getErrResponse(res.error);
}
......@@ -282,6 +286,7 @@ export const dispatchTool = async ({
msg: getErrText(error)
});
}
logger.error('Call tool error', { error });
return getErrResponse(error);
}
};
......@@ -23,6 +23,7 @@ import { getToolRawId } from '@fastgpt/global/core/app/tool/utils';
import { pluginClient } from '../../../../thirdProvider/fastgptPlugin';
import { SystemToolRepo } from '../../../app/tool/systemTool/systemTool.repo';
import { InvokeProcessor } from '../../../../support/invoke/invoke';
import { getLogger, LogCategories } from '../../../../common/logger';
type SystemInputConfigType = {
type: SystemToolSecretInputTypeEnum;
......@@ -53,6 +54,7 @@ export const dispatchRunTool = async (props: RunToolProps): Promise<RunToolRespo
node: { name, avatar, toolConfig, version, catchError }
} = props;
const cTime = String(variableState.get('cTime') ?? '');
const logger = getLogger(LogCategories.MODULE.APP.TOOL);
const {
uid: uId,
......@@ -152,6 +154,7 @@ export const dispatchRunTool = async (props: RunToolProps): Promise<RunToolRespo
};
}
logger.error('Tool Run Error', { error: res.error });
throw res.error;
}
......@@ -327,6 +330,8 @@ export const dispatchRunTool = async (props: RunToolProps): Promise<RunToolRespo
});
}
logger.error('Tool Run Error', { error });
return getNodeErrResponse({
error,
[DispatchNodeResponseKeyEnum.nodeResponse]: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment