(improvement)(chat) modify sql field (#1380)

This commit is contained in:
williamhliu
2024-07-09 19:16:56 +08:00
committed by GitHub
parent ea4aa3eacf
commit c3b3b7e769
2 changed files with 9 additions and 9 deletions

View File

@@ -73,8 +73,8 @@ export type EntityDimensionType = {
};
export type SqlInfoType = {
s2SQL: string;
correctS2SQL: string;
parsedS2SQL: string;
correctedS2SQL: string;
querySQL: string;
};

View File

@@ -38,7 +38,7 @@ const SqlItem: React.FC<Props> = ({
setSqlType('');
};
if (!llmReq && !sqlInfo.s2SQL && !sqlInfo.correctS2SQL && !sqlInfo.querySQL) {
if (!llmReq && !sqlInfo.parsedS2SQL && !sqlInfo.correctedS2SQL && !sqlInfo.querySQL) {
return null;
}
@@ -87,25 +87,25 @@ const SqlItem: React.FC<Props> = ({
Few-shot示例
</div>
)}
{sqlInfo.s2SQL && (
{sqlInfo.parsedS2SQL && (
<div
className={`${tipPrefixCls}-content-option ${
sqlType === 's2SQL' ? `${tipPrefixCls}-content-option-active` : ''
sqlType === 'parsedS2SQL' ? `${tipPrefixCls}-content-option-active` : ''
}`}
onClick={() => {
setSqlType(sqlType === 's2SQL' ? '' : 's2SQL');
setSqlType(sqlType === 'parsedS2SQL' ? '' : 'parsedS2SQL');
}}
>
{queryMode === 'LLM_S2SQL' || queryMode === 'PLAIN_TEXT' ? 'LLM' : 'Rule'}S2SQL
</div>
)}
{sqlInfo.correctS2SQL && (
{sqlInfo.correctedS2SQL && (
<div
className={`${tipPrefixCls}-content-option ${
sqlType === 'correctS2SQL' ? `${tipPrefixCls}-content-option-active` : ''
sqlType === 'correctedS2SQL' ? `${tipPrefixCls}-content-option-active` : ''
}`}
onClick={() => {
setSqlType(sqlType === 'correctS2SQL' ? '' : 'correctS2SQL');
setSqlType(sqlType === 'correctedS2SQL' ? '' : 'correctedS2SQL');
}}
>
S2SQL