update
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ function agentReflex(
|
||||
:actor=>
|
||||
"""
|
||||
Use the following format:
|
||||
Thought: you should always think about what to do according to step {step} of the plan and the info you have (pay attention to correct numeral calculation and commonsense).
|
||||
Thought: you should always think about do you have all the required info and what to do according to step {step} of the plan and the info you have (pay attention to correct numeral calculation and commonsense).
|
||||
Act: the action to take that match your thought, should be one of [{toolnames}]
|
||||
Actinput: the input to the action (pay attention to the tool's input)
|
||||
Obs: the result of the action
|
||||
|
||||
Reference in New Issue
Block a user