This commit is contained in:
Your Name
2023-12-28 10:16:33 +00:00
parent cefb6c166b
commit 0f62a0d96b
2 changed files with 21 additions and 17 deletions

View File

@@ -343,8 +343,8 @@ function actor_mistral_openorca(a::agentReflex, taskrecap="")
start = "Self-awareness"
# aware = "Self-awareness: based on the recap, assess your progress against the plan then identify areas where you need to address."
# aware = "Self-awareness: based on the recap and the plan, state your current understanding of the matter in details then identify areas where you need to address."
aware = "Self-awareness: based on earlier conversation with the user, check your progress against the plan then assess the current situation to identify incomplete tasks. (focus on your actions and their results)"
thought = "Thought: you should always think about what to do according to self-awareness (1. let's think a single step. 2. pay attention to correct numeral calculation and commonsense.)"
aware = "Self-awareness: based on earlier conversation with the user, check your progress against the plan then state incomplete tasks and what you already have. (focus on your actions and their results)"
thought = "Thought: you should always think about what to do according to self-awareness (1. let's think a single step. 2. focus on incomplete task 3. pay attention to correct numeral calculation and commonsense.)"
end
winestockResult = ""
@@ -718,7 +718,9 @@ function conversation(a::agentReflex, usermsg::String; attemptlimit::Int=3)
@show isuseplan
if isuseplan # use plan before responding
a.memory[:shortterm]["User:"] = usermsg
if haskey(a.memory[:shortterm], "User:") == false
a.memory[:shortterm]["User:"] = usermsg
end
workstate, response = work(a)
end

View File

@@ -367,22 +367,24 @@ function isUsePlans(a::agentReflex)
<|assistant|>
"""
# if LLM mentions any tools, use Plan/Thought/Act loop
isuseplan = false
response = sendReceivePrompt(a, prompt, temperature=0.2, max_tokens=64)
response = split(response, "<|assistant|>")[1]
response = split(response, "<|user|>")[1]
# # if LLM mentions any tools, use Plan/Thought/Act loop
# isuseplan = false
# response = sendReceivePrompt(a, prompt, temperature=0.2, max_tokens=64)
# response = split(response, "<|assistant|>")[1]
# response = split(response, "<|user|>")[1]
for (toolname, v) in a.tools
if occursin("Yes", String(response))
isuseplan = true
break
end
end
# for (toolname, v) in a.tools
# if occursin("Yes", String(response))
# isuseplan = true
# break
# end
# end
if length(a.memory[:shortterm]) != 0
isuseplan = true
end
# if length(a.memory[:shortterm]) != 0
# isuseplan = true
# end
isuseplan = true #XXX true because i'm testing sommelier role.
return isuseplan
end