Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -462,6 +462,12 @@ class BERTopicAgent:
|
|
| 462 |
streaming=True,
|
| 463 |
)
|
| 464 |
self._memory = MemorySaver()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 465 |
self._graph = create_react_agent(
|
| 466 |
model=self._llm,
|
| 467 |
tools=TOOLS,
|
|
@@ -650,4 +656,4 @@ class BERTopicAgent:
|
|
| 650 |
self.phase,
|
| 651 |
dict(self._charts),
|
| 652 |
list(self._downloads),
|
| 653 |
-
)
|
|
|
|
| 462 |
streaming=True,
|
| 463 |
)
|
| 464 |
self._memory = MemorySaver()
|
| 465 |
+
|
| 466 |
+
# handle_tool_error is no longer a @tool() decorator argument in
|
| 467 |
+
# newer LangChain versions — set it directly on each tool object.
|
| 468 |
+
for t in TOOLS:
|
| 469 |
+
t.handle_tool_error = True
|
| 470 |
+
|
| 471 |
self._graph = create_react_agent(
|
| 472 |
model=self._llm,
|
| 473 |
tools=TOOLS,
|
|
|
|
| 656 |
self.phase,
|
| 657 |
dict(self._charts),
|
| 658 |
list(self._downloads),
|
| 659 |
+
)
|