Update knowledge generator

This commit is contained in:
Joanna Ren 2024-10-14 17:25:55 -05:00
parent d3e4f44e34
commit 7ef31fcd9e
4 changed files with 13 additions and 5 deletions

View file

@ -54,6 +54,12 @@ public partial class FileRepository
File.WriteAllText(path, JsonSerializer.Serialize(user, _options));
}
public void UpdateExistUser(string userId, User user)
{
user.Id = userId;
CreateUser(user);
}
public void UpdateUserVerified(string userId)
{
var user = GetUserById(userId);

View file

@ -1,7 +1,8 @@
You are a knowledge generator for knowledge base. Extract the answer in "SQL Answer" to answer the User Questions
Replace alias with the actual table name. Output json array only, formatting as [{"question":"string", "answer":"string/sql statement"}].
Skip the question/answer for tmp table.
Don't include tmp table in the answer.
You are a knowledge generator for knowledge base. Extract the answer in "SQL Answer" to answer the User Questions.
* Replace alias with the actual table name. Output json array only, formatting as [{"question":"string", "answer":""}].
* Skip the question/answer for tmp table.
* Don't include tmp table in the answer.
* Include all the explanation comments as additional knowledge.
=====
User Questions:

View file

@ -43,7 +43,7 @@ public class GetTableDefinitionFn : IFunctionCallback
{
var settings = _services.GetRequiredService<SqlDriverSetting>();
var tableDdls = new List<string>();
using var connection = new MySqlConnection(settings.MySqlExecutionConnectionString ?? settings.MySqlConnectionString);
using var connection = new MySqlConnection(settings.MySqlMetaConnectionString ?? settings.MySqlConnectionString);
connection.Open();
foreach (var table in tables)

View file

@ -6,6 +6,7 @@ public class SqlDriverSetting
public string MySqlConnectionString { get; set; } = null!;
public string MySqlExecutionConnectionString { get; set; } = null!;
public string MySqlTempConnectionString { get; set; } = null!;
public string MySqlMetaConnectionString { get; set; } = null!;
public string SqlServerConnectionString { get; set; } = null!;
public string SqlServerExecutionConnectionString { get; set; } = null!;
public string SqlLiteConnectionString { get; set; } = null!;