Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -99,7 +99,7 @@ class LangGraphAgent:
|
|
| 99 |
raw_response = self.model(content)
|
| 100 |
|
| 101 |
# Detect tool usage
|
| 102 |
-
match = re.search(
|
| 103 |
if match:
|
| 104 |
tool_name, tool_input = match.groups()
|
| 105 |
tool_fn = self.tools.get(tool_name)
|
|
|
|
| 99 |
raw_response = self.model(content)
|
| 100 |
|
| 101 |
# Detect tool usage
|
| 102 |
+
match = re.search(rf'Action:\s*({tool_name})\s*Action Input:\s*\"(.+?)\"', raw_response, re.DOTALL)
|
| 103 |
if match:
|
| 104 |
tool_name, tool_input = match.groups()
|
| 105 |
tool_fn = self.tools.get(tool_name)
|