### What problem does this PR solve? Fix #10497 ### Type of change - [X] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
parent
ad56137a59
commit
58836d84fe
1 changed files with 5 additions and 1 deletions
|
|
@ -347,6 +347,10 @@ Respond immediately with your final comprehensive answer.
|
|||
return "Error occurred."
|
||||
|
||||
def reset(self, temp=False):
|
||||
"""
|
||||
Reset all tools if they have a reset method. This avoids errors for tools like MCPToolCallSession.
|
||||
"""
|
||||
for k, cpn in self.tools.items():
|
||||
cpn.reset()
|
||||
if hasattr(cpn, "reset") and callable(cpn.reset):
|
||||
cpn.reset()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue