Skip to content

Commit 008dede

Browse files
authored
Merge pull request #686 from hchen2020/master
Skip refine if tables is empty
2 parents 927dd47 + 742c4d5 commit 008dede

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/Plugins/BotSharp.Plugin.SqlDriver/Functions/ExecuteQueryFn.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ private IEnumerable<dynamic> RunQueryInSqlServer(string[] sqlTexts)
9999

100100
private async Task<ExecuteQueryArgs> RefineSqlStatement(RoleDialogModel message, ExecuteQueryArgs args)
101101
{
102+
if (args.Tables == null || args.Tables.Length == 0)
103+
{
104+
return args;
105+
}
106+
102107
// get table DDL
103108
var fn = _services.GetRequiredService<IRoutingService>();
104109
var msg = RoleDialogModel.From(message);

src/Plugins/BotSharp.Plugin.SqlDriver/data/agents/beda4c12-e1ec-4b4b-b328-3df4a6687c4f/functions/execute_sql.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020

2121
"tables": {
2222
"type": "array",
23-
"description": "all related tables",
23+
"description": "all related tables in the sql statements",
2424
"items": {
2525
"type": "string",
2626
"description": "table name"
2727
}
2828
}
2929
},
30-
"required": [ "sql_statement", "tables", "formatting_result" ]
30+
"required": [ "sql_statements", "tables", "formatting_result" ]
3131
}
3232
}

0 commit comments

Comments
 (0)