mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-12 06:13:36 +00:00
.
This commit is contained in:
parent
f7dcc834a8
commit
d34c1052d9
@ -90,6 +90,8 @@ class XMLAgentOutputParser(AgentOutputParser):
|
||||
# Check for a tool invocation
|
||||
if "<tool>" in text and "</tool>" in text:
|
||||
tool = self._extract_tag_content("tool", text, required=True)
|
||||
if tool is None:
|
||||
raise ValueError("Tool content should not be None when required=True")
|
||||
# Tool input is optional
|
||||
tool_input = (
|
||||
self._extract_tag_content("tool_input", text, required=False) or ""
|
||||
|
Loading…
Reference in New Issue
Block a user