Skip to content

Commit 5d4b6e4

Browse files
authored
conversational agent fix (#818)
1 parent 94ae126 commit 5d4b6e4

File tree

1 file changed

+2
-2
lines changed
  • langchain/agents/conversational

1 file changed

+2
-2
lines changed

langchain/agents/conversational/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ def finish_tool_name(self) -> str:
7575
return self.ai_prefix
7676

7777
def _extract_tool_and_input(self, llm_output: str) -> Optional[Tuple[str, str]]:
78-
if f"{self.ai_prefix}: " in llm_output:
79-
return self.ai_prefix, llm_output.split(f"{self.ai_prefix}: ")[-1]
78+
if f"{self.ai_prefix}:" in llm_output:
79+
return self.ai_prefix, llm_output.split(f"{self.ai_prefix}:")[-1].strip()
8080
regex = r"Action: (.*?)\nAction Input: (.*)"
8181
match = re.search(regex, llm_output)
8282
if not match:

0 commit comments

Comments
 (0)