This commit is contained in:
narawat lamaiin
2025-01-25 14:21:52 +07:00
parent 112db2929c
commit b3345514ca
2 changed files with 8 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
name = "SQLLLM" name = "SQLLLM"
uuid = "2ebc79c7-cc10-4a3a-9665-d2e1d61e63d3" uuid = "2ebc79c7-cc10-4a3a-9665-d2e1d61e63d3"
authors = ["narawat lamaiin <narawat@outlook.com>"] authors = ["narawat lamaiin <narawat@outlook.com>"]
version = "0.2.2-dev" version = "0.2.2"
[deps] [deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"

View File

@@ -149,7 +149,6 @@ function decisionMaker(state::T1, context, text2textInstructLLM::Function,
You should follow the following guidelines: You should follow the following guidelines:
- Do not create any table in the database - Do not create any table in the database
- Column name can be the same in different tables. Refer to column comments to get more details by using TABLEINFO function
- A junction table can be used to link tables together. Another use case is for filtering data. - A junction table can be used to link tables together. Another use case is for filtering data.
- If you can't find a single table that can be used to answer the user's query, try joining multiple tables to see if you can obtain the answer. - If you can't find a single table that can be used to answer the user's query, try joining multiple tables to see if you can obtain the answer.
- If you are unable to find the requested information, kindly inform the user, "The current data in our database does not provide the specific answer to your query". - If you are unable to find the requested information, kindly inform the user, "The current data in our database does not provide the specific answer to your query".
@@ -473,8 +472,9 @@ function evaluator(state::T1, text2textInstructLLM::Function;
"reasoning" is agent's step-by-step reasoning about the current situation "reasoning" is agent's step-by-step reasoning about the current situation
"plan" is agent's plan to complete the task from the current situation "plan" is agent's plan to complete the task from the current situation
"action_name" is the name of the action taken, which can be one of the following functions: "action_name" is the name of the action taken, which can be one of the following functions:
- TABLEINFO[list_of_table_name], which you can use to get the data type of a table column. "list_of_table_name" is a list of table name you want to get info. e.g. TABLEINFO["table name 1", "table name 2"] - GETDATA, which you can use to get the data from the database. Action_input for this function must be a single SQL query to be executed against the database.
- GETDATA[SQL], which you can use to get the data from the database. "SQL" is the single SQL command to be executed against the database. For more effective text search, it's necessary to use case-insensitivity and the ILIKE operator.
Do not wrap the SQL as it will be executed against the database directly and SQL must be ended with ';'.
"action_input" is the input to the action "action_input" is the input to the action
"observation" is result of the preceding immediate action "observation" is result of the preceding immediate action
@@ -978,6 +978,10 @@ function query(query::T, executeSQL::Function, text2textInstructLLM::Function;
insertSQLVectorDB(resultState[:thoughtHistory][:question], sql) insertSQLVectorDB(resultState[:thoughtHistory][:question], sql)
end end
if extracted === nothing #BUG
println("query() return nothing")
end
return (text=extracted, rawresponse=resultState[:rawresponse]) return (text=extracted, rawresponse=resultState[:rawresponse])
end end