From 15ccd002d7387769192685cfd2453edd56e3c63c Mon Sep 17 00:00:00 2001 From: tonaerospace Date: Sat, 16 Dec 2023 07:29:25 +0000 Subject: [PATCH] update --- src/interface.jl | 25 +++++++++++-------------- src/utils.jl | 2 +- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index d707cbb..47879ff 100755 --- a/src/interface.jl +++ b/src/interface.jl @@ -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]) diff --git a/src/utils.jl b/src/utils.jl index 342006a..cb4e9da 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -396,7 +396,7 @@ function isUseTools(a::agentReflex) Your conversation with the user: $conversation - From the user's message, ask yourself what do you intend to do now? + From the conversation, ask yourself what do you intend to do now? <|im_end|> """