diff --git a/Utils/Excel2Prompt.cs b/Utils/Excel2Prompt.cs index 01d3608..2888aa5 100644 --- a/Utils/Excel2Prompt.cs +++ b/Utils/Excel2Prompt.cs @@ -50,14 +50,14 @@ public class Excel2Prompt var nonNullData = columnData.Where(value => value != null).ToList(); var missingValues = columnData.Count - nonNullData.Count; var uniqueValues = nonNullData.Distinct().Count(); - var sampleValues = nonNullData.Take(3).Select(value => value.ToString().Replace("\n"," ")).ToArray(); + var sampleValues = nonNullData.Take(5).Select(value => value.ToString().Replace("\n"," ")).ToArray(); // 自动识别数据类型 var dataType = GetColumnDataType(nonNullData); - var prompt = $"- Column '{column.Replace("\n", " ")}'\n" + - $" - Type: {dataType}\n" + - $" - Sample values: ['{string.Join("', '", sampleValues)}']"; + var prompt = $"- Column '{column.Replace("\n", " ")}'" + + $" - Type: {dataType}" + + $" - Sample values: ['{string.Join("','", sampleValues)}']"; //$" - Unique values: {uniqueValues}\n" + //$" - Missing values: {missingValues}\n"; @@ -70,11 +70,11 @@ public class Excel2Prompt private static string GetColumnDataType(List data) { - bool isInt = true; - bool isLong = true; - bool isDouble = true; - bool isDateTime = true; - bool isBool = true; + var isInt = true; + var isLong = true; + var isDouble = true; + var isDateTime = true; + var isBool = true; foreach (var item in data) {