This commit is contained in:
2024-01-16 14:06:04 +00:00
parent d8d522677c
commit 44006c3112
2 changed files with 9 additions and 7 deletions

View File

@@ -174,6 +174,7 @@ function winestock(a::agentReflex, query::Dict)
while true
_sql = sendReceivePrompt(a, prompt, max_tokens=256, temperature=0.2,
stopword=["/n/n", "END", "End", "Obs", "<|", "</"])
_sql = split(_sql, ";")[1] * ";"
# check for valid SQL command
check_1 = occursin("BETWEEN", _sql)
check_2 = occursin("--", _sql)
@@ -182,6 +183,7 @@ function winestock(a::agentReflex, query::Dict)
if check_1 == false && check_2 == false && check_3 == false
break
end
println("illegal SQL command")
end
println("")
@show db_sql = replace(_sql, '\n'=>"")
@@ -194,9 +196,9 @@ function winestock(a::agentReflex, query::Dict)
break
end
end
sql = split(newsql, ";")[1] * ";"
body = sql
body = newsql
uri = URI(scheme="http", host="192.168.88.12", port="9010", path="/sql", userinfo="root:root")
r = HTTP.request("POST", uri, ["Accept" => "application/json", "NS"=>"yiem", "DB"=>"Blossom_wines"], body)
println("")