v0.7.4-add_vector_search #33
+3
-3
@@ -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"]
|
||||
|
||||
+1
-1
@@ -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"
|
||||
|
||||
+20
-4
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user