(improvement)(chat-sdk) add question in export log and hide date range picker when dateInfo is null (#1550)

This commit is contained in:
williamhliu
2024-08-10 10:17:41 +08:00
committed by GitHub
parent db698ecb75
commit da0ac7b26c
3 changed files with 38 additions and 28 deletions

View File

@@ -252,34 +252,36 @@ const ParseTip: React.FC<Props> = ({
});
return (
<div className={`${prefixCls}-tip-item-filter-content`}>
<div className={tipItemOptionClass}>
<span className={`${prefixCls}-tip-item-filter-name`}></span>
{nativeQuery ? (
<span className={itemValueClass}>
{startDate === endDate ? startDate : `${startDate} ~ ${endDate}`}
</span>
) : (
<RangePicker
value={[dayjs(startDate), dayjs(endDate)]}
onChange={onDateInfoChange}
format="YYYY-MM-DD"
renderExtraFooter={() => (
<Row gutter={[28, 28]}>
{Object.keys(ranges).map(key => (
<Col key={key}>
<Button
size="small"
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
>
{key}
</Button>
</Col>
))}
</Row>
)}
/>
)}
</div>
{!!dateInfo && (
<div className={tipItemOptionClass}>
<span className={`${prefixCls}-tip-item-filter-name`}></span>
{nativeQuery ? (
<span className={itemValueClass}>
{startDate === endDate ? startDate : `${startDate} ~ ${endDate}`}
</span>
) : (
<RangePicker
value={[dayjs(startDate), dayjs(endDate)]}
onChange={onDateInfoChange}
format="YYYY-MM-DD"
renderExtraFooter={() => (
<Row gutter={[28, 28]}>
{Object.keys(ranges).map(key => (
<Col key={key}>
<Button
size="small"
onClick={() => handlePresetClick(ranges[key as RangeKeys])}
>
{key}
</Button>
</Col>
))}
</Row>
)}
/>
)}
</div>
)}
{filters?.map((filter: any, index: number) => (
<FilterItem
modelId={modelId!}

View File

@@ -12,6 +12,7 @@ import { exportTextFile } from '../../utils/utils';
type Props = {
agentId?: number;
queryId: number;
question: string;
llmReq?: any;
llmResp?: any;
integrateSystem?: string;
@@ -23,6 +24,7 @@ type Props = {
const SqlItem: React.FC<Props> = ({
agentId,
queryId,
question,
llmReq,
llmResp,
integrateSystem,
@@ -126,6 +128,11 @@ ${format(sqlInfo.querySQL)}
const onExportLog = () => {
let text = '';
if (question) {
text += `
问题:${question}
`;
}
if (llmReq) {
text += getSchemaMapText();
}

View File

@@ -353,6 +353,7 @@ const ChatItem: React.FC<Props> = ({
<SqlItem
agentId={agentId}
queryId={parseInfo.queryId}
question={msg}
llmReq={llmReq}
llmResp={llmResp}
integrateSystem={integrateSystem}