This commit is contained in:
youremail@yourdomain.com
2023-12-23 12:14:10 +00:00
parent ca31fbed33
commit e0c5910d76
2 changed files with 11 additions and 14 deletions

View File

@@ -1082,21 +1082,18 @@ function checkTaskCompletion(a)
"""
response = nothing
_response = nothing
while true
_response = sendReceivePrompt(a, prompt, max_tokens=512)
_response = split(_response, "</s|>")[1]
if occursin("}", _response)
break
end
end
response = "I " * split(_response, "{")[1] # sometime response have more than 1 {answer: done}
_response = sendReceivePrompt(a, prompt, max_tokens=512)
@show checkTaskCompletion_raw = _response
_response = split(_response, "</s|>")[1]
_response = split(_response, "\n\n")[1]
# response = "I " * split(_response, "{")[1] # sometime response have more than 1 {answer: done}
decision = nothing
if occursin("done", response)
decision = true
else
decision = false
end
# if occursin("done", response)
# decision = true
# else
# decision = false
# end
return decision, response
end

View File

@@ -170,7 +170,7 @@ function agentReflex(
Use the following format:
Thought: based on the plan and progress evaluation of the plan, what to do? (pay attention to correct numeral calculation and commonsense).
Act: an action to take based on your thought, must be one of [{toolnames}]
Actinput: your input to the action you chose (pay attention to the tool's input)
Actinput: your input to the action based on your thought (pay attention to the tool's input)
Obs: observed result of the action
P.S.1 ask user one by one question.