fix templates

Former-commit-id: 6f357d59b73309c5955683008632e7f320e7dcb1
This commit is contained in:
hiyouga
2024-06-19 17:44:05 +08:00
parent 235ed85b0f
commit 3e0fa4a8da
3 changed files with 18 additions and 35 deletions

View File

@@ -68,7 +68,7 @@ def default_tool_formatter(tools: List[Dict[str, Any]]) -> str:
def default_tool_extractor(content: str) -> Union[str, List[Tuple[str, str]]]:
regex = re.compile(r"Action:\s*([a-zA-Z0-9_]+)\s*Action Input:\s*(.+?)(?=\s*Action:|$)", re.DOTALL)
regex = re.compile(r"Action:\s*([a-zA-Z0-9_]+)\s*Action Input:\s*(.+?)(?=\s*Action:|\s*$)", re.DOTALL)
action_match: List[Tuple[str, str]] = re.findall(regex, content)
if not action_match:
return content