diff --git a/src/interface.jl b/src/interface.jl index 4bd6edf..4888be2 100755 --- a/src/interface.jl +++ b/src/interface.jl @@ -373,7 +373,7 @@ function actor_mistral_openorca(a::agentReflex) {context} <|im_end|> {shorttermMemory} - Thought $mark: + Thought: """ prompt = replace(prompt, "{role}" => a.roles[a.role]) @@ -780,9 +780,10 @@ function actor(a::agentReflex) respond = split(respond, "Obs")[1] respond_actor_raw = respond @show respond_actor_raw - - ind = findfirst(":", respond)[end] - respond = respond[ind+1:end] + if occursin("Thought", respond) + ind = findfirst(":", respond)[end] + respond = respond[ind+1:end] + end respond = "Thought: " * respond # some time LLM not generate a number after headers but I want it @@ -825,7 +826,6 @@ function actor(a::agentReflex) respond = toolinput msgToUser = respond actorState = toolname - a.step += 1 break else # function call f = a.tools[Symbol(toolname)][:func] diff --git a/src/type.jl b/src/type.jl index ebd5085..70e5744 100644 --- a/src/type.jl +++ b/src/type.jl @@ -110,7 +110,7 @@ function agentReflex( :actor=> """ Use the following format: - Thought: think about what to do according to step {step} of the plan? (pay attention to correct numeral calculation and commonsense). + Thought: ask yourself do you have all the info you need and what to do according to step {step} of the plan (pay attention to correct numeral calculation and commonsense). Act: the action to take that match your thought, should be one of [{toolnames}] ActInput: the input to the action (pay attention to the tool's input) Obs: the result of the action