This commit is contained in:
2023-12-07 04:47:25 +00:00
parent 7765d0c4cf
commit 7482f1e933
2 changed files with 7 additions and 14 deletions

View File

@@ -644,13 +644,12 @@ function work(a::agentReflex, usermsg::String)
while true # Work loop
# plan
@show a.attempt
@show usermsg
if a.attempt <= a.attemptlimit
toolname = nothing
toolinput = nothing
if a.newplan == true
a.attempt += 1
a.step = 0
prompt_plan = planner_mistral_openorca(a)
println("")
@show prompt_plan
@@ -665,13 +664,14 @@ function work(a::agentReflex, usermsg::String)
println("")
@show plan
a.attempt += 1
a.step = 0
a.newplan = false
a.memory[:shortterm]["Plan $(a.attempt):"] = plan
a.memory[:log]["Plan $(a.attempt):"] = plan
end
@show a.attempt
@show a.memory[:shortterm]["user:"]
# enter actor loop
actorstate, msgToUser = actor(a)
@@ -717,6 +717,7 @@ function work(a::agentReflex, usermsg::String)
@show chunkedtext
a.memory[:longterm][chunkedtext["Context:"]] = chunkedtext["Lesson:"]
a.newplan = true
println("")
end
else
error("undefied condition, actorstate $actorstate $(@__LINE__)")
@@ -1023,14 +1024,6 @@ function analyze(a)
respond = sendReceivePrompt(a, prompt, max_tokens=1024, timeout=180)
println("")
analyze_prompt = prompt
@show analyze_prompt
println(">>>")
analyze_respond = respond
@show analyze_respond
return respond
end