feat: add plan in model output

feature/stdout-breaker
adldotori 1 year ago
parent 0ab3bbced4
commit 8df3214024

@ -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"

@ -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.
"""

Loading…
Cancel
Save