From b3345514ca3639e9e692aa4d1673c3ce1eee16c4 Mon Sep 17 00:00:00 2001 From: narawat lamaiin Date: Sat, 25 Jan 2025 14:21:52 +0700 Subject: [PATCH] update --- Project.toml | 2 +- src/interface.jl | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Project.toml b/Project.toml index d7e0595..763aca5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SQLLLM" uuid = "2ebc79c7-cc10-4a3a-9665-d2e1d61e63d3" authors = ["narawat lamaiin "] -version = "0.2.2-dev" +version = "0.2.2" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" diff --git a/src/interface.jl b/src/interface.jl index 5c8d136..520a706 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -149,7 +149,6 @@ function decisionMaker(state::T1, context, text2textInstructLLM::Function, You should follow the following guidelines: - 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. - 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". @@ -473,8 +472,9 @@ function evaluator(state::T1, text2textInstructLLM::Function; "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 "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[SQL], which you can use to get the data from the database. "SQL" is the single SQL command to be executed against the database. + - 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. + 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 "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) end + if extracted === nothing #BUG + println("query() return nothing") + end + return (text=extracted, rawresponse=resultState[:rawresponse]) end