This commit is contained in:
2023-12-16 17:42:52 +00:00
parent be92ec2521
commit 31cbb9130a

View File

@@ -276,12 +276,12 @@ function planner_mistral_openorca(a::agentReflex)
"""
<|im_start|>system
$(a.roles[a.role])
The required info you must ask the user:
- type of food
- occasion
- user's personal taste of wine
- wine price range
- ambient temperature at the serving location
The required info you need for wine recommendation:
- type of food: ask the user
- occasion: ask the user
- user's personal taste of wine: ask the user
- wine price range: ask the user
- ambient temperature at the serving location: ask the user
- wines we have in stock
You provide a personalized recommendation of up to two wines based on the user's info above, and you describe the benefits of each wine in detail.
@@ -290,9 +290,10 @@ function planner_mistral_openorca(a::agentReflex)
Use the following format:
Objective: the objective you intend to do
Plan: first you should always think about the objective, the info you need and the info you have thoroughly then extract and devise a complete, step by step plan (pay attention to correct numeral calculation and commonsense).
Aware: ask yourself what info you don't have?
Plan: first you should always think about the objective, the info you have, the info you don't have and thoroughly then extract and devise a complete, step by step plan (pay attention to correct numeral calculation and commonsense).
p.s.1 each step of the plan should be a single action.
p.s.2 it is better to ask all you need to know and then search your inventory.
p.s.2 ask the user all you need to know and then search your inventory.
<|im_end|>
$conversation
<|im_start|>assistant
@@ -671,14 +672,14 @@ function work(a::agentReflex)
a.memory[:log]["response $(a.attempt):"] = response
# evaluate. if score > 6/10 good enough.
guideline = writeEvaluationGuideline(a, a.memory[:shortterm]["user:"])
guideline = writeEvaluationGuideline(a, objective)
println("")
@show guideline
score = grading(a, guideline, response)
@show score
if score > 6 # good enough answer
if score > 5 # good enough answer
break
else # self evaluate and reflect then try again
analysis = analyze(a)
@@ -1212,7 +1213,7 @@ julia> report = analyze(agent, shorttermMemory)
```
"""
function analyze(a)
shorttermMemory = dictToString(a.memory[:shortterm], ["user:"])
shorttermMemory = dictToString(a.memory[:shortterm])
prompt =
"""
<|im_start|>system