update
This commit is contained in:
+7
-4
@@ -308,11 +308,8 @@ function checkwine!(a::T, thoughtdict::AbstractDict; useSQLLLM::Bool=false
|
|||||||
|
|
||||||
# direct query with possible sql instead of SQLLLM.
|
# direct query with possible sql instead of SQLLLM.
|
||||||
sql = generatesql(a, inventoryquery)
|
sql = generatesql(a, inventoryquery)
|
||||||
|
|
||||||
textresult, result_raw, _, _ = SQLexecution(a.context.executeSQL, sql)
|
textresult, result_raw, _, _ = SQLexecution(a.context.executeSQL, sql)
|
||||||
|
|
||||||
thoughtdict["action_result"] = textresult
|
thoughtdict["action_result"] = textresult
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
return (thoughtdict=thoughtdict, result_raw=result_raw)
|
return (thoughtdict=thoughtdict, result_raw=result_raw)
|
||||||
@@ -482,8 +479,14 @@ function generatesql(a::T, searchterm::String,
|
|||||||
requiredKeys = ["plan", "action_name", "action_input"]
|
requiredKeys = ["plan", "action_name", "action_input"]
|
||||||
errornote = ""
|
errornote = ""
|
||||||
# provide similar sql only for the first attempt
|
# provide similar sql only for the first attempt
|
||||||
sql, _ = a.context.similarSQLVectorDB(searchterm)
|
sql, distance = a.context.similarSQLVectorDB(searchterm)
|
||||||
similarSQL_ = sql !== nothing ? sql : "None"
|
similarSQL_ = sql !== nothing ? sql : "None"
|
||||||
|
|
||||||
|
# if sql is really close, just use it
|
||||||
|
if distance <= 0.1
|
||||||
|
return similarSQL_
|
||||||
|
end
|
||||||
|
|
||||||
context =
|
context =
|
||||||
"""
|
"""
|
||||||
<internal_context_for_assistant>
|
<internal_context_for_assistant>
|
||||||
|
|||||||
Reference in New Issue
Block a user