update
This commit is contained in:
+6
-6
@@ -1,9 +1,9 @@
|
||||
using Revise
|
||||
using LibPQ, Dates, JSON3, PrettyPrinting, UUIDs, DataFrames, DataStructures, Base64
|
||||
using LibPQ, Dates, JSON, PrettyPrinting, UUIDs, DataFrames, DataStructures, Base64
|
||||
using GeneralUtils, SQLLLM
|
||||
|
||||
|
||||
config = JSON3.read("/appfolder/app/dev/YiemAgent/test/config.json")
|
||||
config = JSON.parse("/appfolder/app/dev/YiemAgent/test/config.json")
|
||||
|
||||
function executeSQL(sql::T) where {T<:AbstractString}
|
||||
host = config[:externalservice][:wineDB][:host]
|
||||
@@ -173,7 +173,7 @@ function similarSommelierDecision(recentevents::T1; maxdistance::Integer=3
|
||||
println("\n~~~ found similar decision. row id $rowid, distance $distance ", @__FILE__, " ", @__LINE__)
|
||||
output_b64 = df[1, :function_output_base64] # pick the closest match
|
||||
_output_str = String(base64decode(output_b64))
|
||||
output = copy(JSON3.read(_output_str))
|
||||
output = copy(JSON.parse(_output_str))
|
||||
return output
|
||||
else
|
||||
println("\n~~~ similar decision not found, max distance $maxdistance ", @__FILE__, " ", @__LINE__)
|
||||
@@ -193,7 +193,7 @@ function insertSommelierDecision(recentevents::T1, decision::T2; maxdistance::In
|
||||
if row == 0 || distance > maxdistance # no close enough SQL stored in the database
|
||||
recentevents_embedding = getEmbedding(recentevents)[1]
|
||||
recentevents = replace(recentevents, "'" => "")
|
||||
decision_json = JSON3.write(decision)
|
||||
decision_json = JSON.json(decision)
|
||||
decision_base64 = base64encode(decision_json)
|
||||
decision = replace(decision_json, "'" => "")
|
||||
|
||||
@@ -212,14 +212,14 @@ sessionId = GeneralUtils.uuid4snakecase()
|
||||
d = Dict(:id => sessionId)
|
||||
filepath = "/appfolder/app/sessionid.json"
|
||||
open(filepath, "w") do io
|
||||
JSON3.pretty(io, d)
|
||||
JSON.pretty(io, d)
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
# query = "How many German wines do you have?"
|
||||
# highValueStateList = copy(JSON3.read("/appfolder/app/highValueState_1.json"))
|
||||
# highValueStateList = copy(JSON.parse("/appfolder/app/highValueState_1.json"))
|
||||
# selectedState = SQLLLM.compareState(query, highValueStateList, text2textInstructLLM)
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
using Revise
|
||||
using LibPQ, JSON3, PrettyPrinting, UUIDs, DataFrames, DataStructures, Dates, MQTTClient, Random
|
||||
using LibPQ, JSON, PrettyPrinting, UUIDs, DataFrames, DataStructures, Dates, MQTTClient, Random
|
||||
using SQLLLM, GeneralUtils
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ df = DataFrame(result)
|
||||
|
||||
|
||||
|
||||
config = copy(JSON3.read("config.json"))
|
||||
config = copy(JSON.parse("config.json"))
|
||||
|
||||
msgMeta = GeneralUtils.generate_msgMeta(
|
||||
config[:externalservice][:text2textinstruct][:mqtttopic];
|
||||
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
# using Revise
|
||||
# using SQLLLM, LLMMCTS, DataStructures, JSON3
|
||||
# using SQLLLM, LLMMCTS, DataStructures, JSON
|
||||
|
||||
# query = "How many German wines do you have?"
|
||||
# highValueStateList = copy(JSON3.read("/appfolder/app/highValueState_1.json"))
|
||||
# highValueStateList = copy(JSON.parse("/appfolder/app/highValueState_1.json"))
|
||||
# selectedState = SQLLLM.compareState(query, highValueStateList)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user