From 3c72373b8535df522be69f0aca31ce3af0a38b5e Mon Sep 17 00:00:00 2001 From: narawat Date: Sun, 12 Jul 2026 05:54:47 +0700 Subject: [PATCH] update --- src/llmfunction.jl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/llmfunction.jl b/src/llmfunction.jl index 3c1e0a0..8afd118 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -308,11 +308,8 @@ function checkwine!(a::T, thoughtdict::AbstractDict; useSQLLLM::Bool=false # direct query with possible sql instead of SQLLLM. sql = generatesql(a, inventoryquery) - textresult, result_raw, _, _ = SQLexecution(a.context.executeSQL, sql) - thoughtdict["action_result"] = textresult - end return (thoughtdict=thoughtdict, result_raw=result_raw) @@ -482,8 +479,14 @@ function generatesql(a::T, searchterm::String, requiredKeys = ["plan", "action_name", "action_input"] errornote = "" # provide similar sql only for the first attempt - sql, _ = a.context.similarSQLVectorDB(searchterm) + sql, distance = a.context.similarSQLVectorDB(searchterm) similarSQL_ = sql !== nothing ? sql : "None" + + # if sql is really close, just use it + if distance <= 0.1 + return similarSQL_ + end + context = """