(feature)(chat-sdk) modify export log file name (#1484)

This commit is contained in:
williamhliu
2024-07-30 15:40:29 +08:00
committed by GitHub
parent e571ca1f55
commit b45f3d0663
2 changed files with 7 additions and 1 deletions

View File

@@ -10,6 +10,8 @@ import { SqlInfoType } from '../../common/type';
import { exportTextFile } from '../../utils/utils'; import { exportTextFile } from '../../utils/utils';
type Props = { type Props = {
agentId?: number;
queryId: number;
llmReq?: any; llmReq?: any;
llmResp?: any; llmResp?: any;
integrateSystem?: string; integrateSystem?: string;
@@ -19,6 +21,8 @@ type Props = {
}; };
const SqlItem: React.FC<Props> = ({ const SqlItem: React.FC<Props> = ({
agentId,
queryId,
llmReq, llmReq,
llmResp, llmResp,
integrateSystem, integrateSystem,
@@ -137,7 +141,7 @@ ${format(sqlInfo.querySQL)}
if (sqlInfo.querySQL) { if (sqlInfo.querySQL) {
text += getQuerySQLText(); text += getQuerySQLText();
} }
exportTextFile(text, 'file.txt'); exportTextFile(text, `supersonic-debug-${agentId}-${queryId}.log`);
}; };
return ( return (

View File

@@ -358,6 +358,8 @@ const ChatItem: React.FC<Props> = ({
<> <>
{!isMobile && parseInfo?.sqlInfo && isDeveloper && isDebugMode && !isSimpleMode && ( {!isMobile && parseInfo?.sqlInfo && isDeveloper && isDebugMode && !isSimpleMode && (
<SqlItem <SqlItem
agentId={agentId}
queryId={parseInfo.queryId}
llmReq={llmReq} llmReq={llmReq}
llmResp={llmResp} llmResp={llmResp}
integrateSystem={integrateSystem} integrateSystem={integrateSystem}