(improvement)(chat-sdk) modify sql field and plugin card width (#1662)

This commit is contained in:
williamhliu
2024-09-12 20:32:01 +08:00
committed by GitHub
parent c99d240b65
commit e07ba7cfdb
2 changed files with 15 additions and 11 deletions

View File

@@ -49,7 +49,7 @@ const SqlItem: React.FC<Props> = ({
return null;
}
const { schema, linking, priorExts } = llmReq || {};
const { schema, terms, priorExts } = llmReq || {};
const fewShots = (Object.values(llmResp?.sqlRespMap || {})[0] as any)?.fewShots || [];
@@ -57,9 +57,9 @@ const SqlItem: React.FC<Props> = ({
return `
Schema映射
${schema?.fieldNameList?.length > 0 ? `名称:${schema.fieldNameList.join('、')}` : ''}${
linking?.length > 0
schema?.values?.length > 0
? `
取值:${linking
取值:${schema.values
.map((item: any) => {
return `${item.fieldName}: ${item.fieldValue}`;
})
@@ -71,9 +71,9 @@ ${schema?.fieldNameList?.length > 0 ? `名称:${schema.fieldNameList.join('、
附加:${priorExts}`
: ''
}${
schema?.terms?.length > 0
terms?.length > 0
? `
术语:${schema.terms
术语:${terms
.map((item: any) => {
return `${item.name}${item.alias?.length > 0 ? `(${item.alias.join(',')})` : ''}: ${
item.description
@@ -253,11 +253,11 @@ ${format(sqlInfo.querySQL)}
</div>
</div>
)}
{linking?.length > 0 && (
{schema?.values?.length > 0 && (
<div className={`${prefixCls}-schema-row`}>
<div className={`${prefixCls}-schema-title`}></div>
<div className={`${prefixCls}-schema-content`}>
{linking
{schema.values
.map((item: any) => {
return `${item.fieldName}: ${item.fieldValue}`;
})
@@ -271,11 +271,11 @@ ${format(sqlInfo.querySQL)}
<div className={`${prefixCls}-schema-content`}>{priorExts}</div>
</div>
)}
{schema?.terms?.length > 0 && (
{terms?.length > 0 && (
<div className={`${prefixCls}-schema-row`}>
<div className={`${prefixCls}-schema-title`}></div>
<div className={`${prefixCls}-schema-content`}>
{schema.terms
{terms
.map((item: any) => {
return `${item.name}${
item.alias?.length > 0 ? `(${item.alias.join(',')})` : ''