From f8b3150c1780f9feca8dc11d005e9a6b3754ac06 Mon Sep 17 00:00:00 2001 From: narawat Date: Fri, 24 Jul 2026 16:44:49 +0700 Subject: [PATCH] update --- Manifest.toml | 6 +++--- Project.toml | 2 +- src/llmfunction.jl | 24 ++++++++++++++++++++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index 5bfcb9f..ff24a8c 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -2,7 +2,7 @@ julia_version = "1.12.6" manifest_format = "2.0" -project_hash = "fec141f7ff95c7150e820def295f9929445168b6" +project_hash = "be97ee6871e6226aa3a499d3dfac9cc08bccdfdc" [[deps.Accessors]] deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "MacroTools"] @@ -300,11 +300,11 @@ version = "1.1.0" [[deps.GeneralUtils]] deps = ["CSV", "DataFrames", "DataStructures", "Dates", "Distributions", "Graphs", "HTTP", "JSON", "LibPQ", "NATS", "PrettyPrinting", "Random", "Revise", "SHA", "StringDistances", "UUIDs"] -git-tree-sha1 = "596da266c851d00fbabcf33660419aeffb820fcb" +git-tree-sha1 = "779dc73098f322590b94dc315a497307a0e053d1" repo-rev = "main" repo-url = "https://git.yiem.cc/ton/GeneralUtils" uuid = "c6c72f09-b708-4ac8-ac7c-2084d70108fe" -version = "0.5.7" +version = "0.5.8" [[deps.Graphs]] deps = ["ArnoldiMethod", "DataStructures", "Inflate", "LinearAlgebra", "Random", "SimpleTraits", "SparseArrays", "Statistics"] diff --git a/Project.toml b/Project.toml index 64d5fbf..2ac1798 100644 --- a/Project.toml +++ b/Project.toml @@ -28,7 +28,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" Base64 = "1.11.0" CSV = "0.10.15" DataFrames = "1.7.0" -GeneralUtils = "0.5.7" +GeneralUtils = "0.5.8" HTTP = "2.4.0" JSON = "1.6.1" LLMMCTS = "0.1.5" diff --git a/src/llmfunction.jl b/src/llmfunction.jl index fcaf28c..8d5cc52 100644 --- a/src/llmfunction.jl +++ b/src/llmfunction.jl @@ -302,16 +302,32 @@ function search_wine_database!(a::T, thoughtdict::AbstractDict; useSQLLLM::Bool= else # direct query with possible sql instead of SQLLLM. - hard_conditions, vector_search_words = wine_search_term_classification(a, thoughtdict["action_input"]) + hard_conditions, vector_search = wine_search_term_classification(a, thoughtdict["action_input"]) # do hard filter # sql = generatesql(a, inventoryquery) sql = predefined_wine_search_sql(hard_conditions) - @info "\nsql: $sql, \nvector_search_words: $vector_search_words" + @info "\nsql: $sql, \nvector_search: $vector_search" textresult, sql_result_df, success, _ = SQLexecution(a.context.executeSQL, sql) - #WORKING do vector search - GeneralUtils.find_text_vector_similarity(vector_search_words, "wine") + # do vector search + vector_search_str = "" + for i in vector_search + vector_search_str = vector_search_str * " " * i["value"] + end + vector_search_str = String(strip(vector_search_str)) + vector_search_str = GeneralUtils.removestring(vector_search_str, ["%"]) + @show vector_search + @show vector_search_str + + #WORKING + GeneralUtils.find_text_vector_similarity(vector_search_str, "wine", "tasting_notes_embedding", + GeneralUtils.execute) + + + + + items = nothing if sql_result_df !== nothing