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

@@ -362,15 +362,15 @@ function selfAwareness(a::agentReflex)
$aboutYourself
$(a.roleSpecificInstruction[a.role])
</About yourself>
<Your work>
<Your earlier work>
$work
</your work
</Your earlier work>
<Your plan>
$(a.memory[:shortterm]["Plan 1:"])
</Your plan>
<Your job>
Use the following format strictly:
What do I know: based on observed results, repeat all the details of what you have been gathered.
What do I know: based on observed results, repeat all the information you are gathering.
What am I missing: based on observed results, describe in detail what you are still missing compared to your plan.
P.S. do not mention any toolnames
</Your job>
@@ -450,7 +450,7 @@ function actor_mistral_openorca(a::agentReflex, selfaware=nothing)
# aware = "Self-awareness: Based on action's input and observed results, check your progress against the plan. Then, repeat all the details of what you have been gathered. Finally, describe in detail what you are missing."
thought =
"Self-awareness: $selfaware
Thought: based on self-awareness, you should always prioritize what you are missing first. Then think about what to do next. (P.S. 1) let's think a single step. 2) pay attention to correct numeral calculation and commonsense.)
Thought: based on self-awareness, You should always plan your next steps and focus on what you missed first. (P.S. 1) let's think a single step. 2) pay attention to correct numeral calculation and commonsense.)
"
end
@@ -930,7 +930,7 @@ function work(a::agentReflex)
latestTask = shortMemLatestTask(a.memory[:shortterm])
if haskey(a.memory[:shortterm], "Act $latestTask:")
if occursin("askbox", a.memory[:shortterm]["Act $latestTask:"])
a.memory[:shortterm]["Obs $latestTask:"] = "(user response) " * a.messages[end][:content]
a.memory[:shortterm]["Obs $latestTask:"] = "user response: " * a.messages[end][:content]
end
end
end

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("")