diff --git a/core/agents/parser.py b/core/agents/parser.py index 92908e6..08832f6 100644 --- a/core/agents/parser.py +++ b/core/agents/parser.py @@ -11,10 +11,13 @@ class EvalOutputParser(BaseOutputParser): return EVAL_FORMAT_INSTRUCTIONS def parse(self, text: str) -> Dict[str, str]: - regex = r"Action: (.*?)[\n]*Action Input: (.*)" + regex = r"Action: (.*?)[\n]Plan:(.*)Action Input: (.*)" match = re.search(regex, text, re.DOTALL) if not match: raise Exception("parse error") action = match.group(1).strip() - action_input = match.group(2) + action_input = match.group(3) return {"action": action, "action_input": action_input.strip(" ").strip('"')} + + def __str__(self): + return "EvalOutputParser" diff --git a/core/prompts/input.py b/core/prompts/input.py index 37813b9..da92b41 100644 --- a/core/prompts/input.py +++ b/core/prompts/input.py @@ -18,6 +18,7 @@ Use this if you want the human to use a tool. Your response should be in the following schema: Action: the action to take, should be one of [{tool_names}] +Plan: All remaining detailed plans after this action in bullet points. Action Input: the input to the action **Option #2:** @@ -26,6 +27,7 @@ You should replace sensitive data or encrypted data with "d1dy0uth1nk7hat1t1s7ha Your response should be in the following schema: Action: Final Answer +Plan: None Action Input: string \\ You should put what you want to return to use here. """