Merge pull request #732 from hchen2020/master

Fix dictionary lookup
This commit is contained in:
Haiping 2024-11-06 22:05:24 +00:00 committed by GitHub
commit fe4d0a8e01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -78,7 +78,7 @@ public class VerifyDictionaryTerm : IFunctionCallback
var render = _services.GetRequiredService<ITemplateRender>();
var knowledgeHooks = _services.GetServices<IKnowledgeHook>();
var agent = await agentService.GetAgent(BuiltInAgentId.Planner);
var agent = await agentService.GetAgent(BuiltInAgentId.SqlDriver);
var template = agent.Templates.FirstOrDefault(x => x.Name == "database.dictionary.sql")?.Content ?? string.Empty;
var responseFormat = JsonSerializer.Serialize(new LookupDictionary{ });

View file

@ -7,7 +7,7 @@ namespace BotSharp.Plugin.SqlDriver.Hooks;
public class SqlDictionaryLookupHook : AgentHookBase, IAgentHook
{
private const string SQL_EXECUTOR_TEMPLATE = "sql_dictionary_lookup.fn";
private const string SQL_EXECUTOR_TEMPLATE = "verify_dictionary_term.fn";
private IEnumerable<string> _targetSqlExecutorFunctions = new List<string>
{
"verify_dictionary_term",