Davit6174 commited on
Commit
a42ef03
·
verified ·
1 Parent(s): 325c680

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -99,7 +99,7 @@ class LangGraphAgent:
99
  raw_response = self.model(content)
100
 
101
  # Detect tool usage
102
- match = re.search(r"Action:\s*(\w+)\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)
 
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)