mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-31 08:32:32 +00:00
conversational agent fix (#818)
This commit is contained in:
parent
94ae126747
commit
5d4b6e4d4e
@ -75,8 +75,8 @@ class ConversationalAgent(Agent):
|
||||
return self.ai_prefix
|
||||
|
||||
def _extract_tool_and_input(self, llm_output: str) -> Optional[Tuple[str, str]]:
|
||||
if f"{self.ai_prefix}: " in llm_output:
|
||||
return self.ai_prefix, llm_output.split(f"{self.ai_prefix}: ")[-1]
|
||||
if f"{self.ai_prefix}:" in llm_output:
|
||||
return self.ai_prefix, llm_output.split(f"{self.ai_prefix}:")[-1].strip()
|
||||
regex = r"Action: (.*?)\nAction Input: (.*)"
|
||||
match = re.search(regex, llm_output)
|
||||
if not match:
|
||||
|
Loading…
Reference in New Issue
Block a user