This commit is contained in:
2023-12-16 07:29:25 +00:00
parent d202690286
commit 15ccd002d7
2 changed files with 12 additions and 15 deletions

View File

@@ -276,7 +276,7 @@ function planner_mistral_openorca(a::agentReflex)
"""
<|im_start|>system
$(a.roles[a.role])
The info you need from the user to be able to help them selecting their best wine:
The required info you must ask the user:
- type of food
- occasion
- user's personal taste of wine
@@ -290,17 +290,16 @@ 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 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 make sure you gather all the required information.
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).
<|im_end|>
$conversation
<|im_start|>assistant
Objective:
"""
# p.s.1 each step of the plan should be a single action.
# p.s.2 the last step should be about responding.
result = sendReceivePrompt(a, assistant_plan_prompt, max_tokens=1024, temperature=0.2)
result = sendReceivePrompt(a, assistant_plan_prompt, max_tokens=1024, temperature=0.1)
@show raw_plan = result
x = split(result, "<|im_end|>")[1]
x = split(x, "Step")[1]
@@ -1050,7 +1049,7 @@ function actor(a::agentReflex)
actorState = toolname
break
elseif toolname == "skipstep"
# skip
a.step += 1
else # function call
f = a.tools[toolname][:func]
toolresult = f(a, toolinput)
@@ -1312,28 +1311,26 @@ julia> report = formulateUserresponse(agent, shorttermMemory)
```
"""
function formulateUserresponse(a)
stimulus = a.memory[:shortterm]["user:"] #BUG no "user" key
work = dictToString(a.memory[:shortterm], ["user:"])
conversation = messagesToString_nomark(a.messages, addressAIas="I")
work = dictToString(a.memory[:shortterm])
prompt =
"""
<|im_start|>system
Symbol:
Stimulus: the input user gives to you and you must response
Plan: a plan
Thought: your thought
Act: the action you took
Actinput: the input to the action
Obs: the result of the action
Stimulus:
$stimulus
Your talk with the user:
$conversation
Your work:
$work
From your work, formulate a response for user's stimulus.
From your talk with the user and your work, formulate a response for the user.
<|im_end|>
response:
"""
@@ -1368,7 +1365,7 @@ julia> shorttermMemory = OrderedDict{String, Any}(
julia> decision = goNogo(agent)
"Yes"
```
""" #WORKING add choice skip, if LLM already completed the step
"""
function goNogo(a)
# stimulus = a.memory[:shortterm]["user:"]
work = dictToString(a.memory[:shortterm])