From 89a60a2668cdff0e3c92c73b361044f3595060c8 Mon Sep 17 00:00:00 2001 From: Arsenii Shatokhin Date: Thu, 15 Aug 2024 08:13:02 +0400 Subject: [PATCH] Fix shared state initialization when testing tools separately #165 --- agency_swarm/tools/BaseTool.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agency_swarm/tools/BaseTool.py b/agency_swarm/tools/BaseTool.py index 22f31236..c0495642 100644 --- a/agency_swarm/tools/BaseTool.py +++ b/agency_swarm/tools/BaseTool.py @@ -12,7 +12,12 @@ class BaseTool(OpenAISchema, ABC): caller_agent: Any = None event_handler: Any = None one_call_at_a_time: bool = False - + + def __init__(self, **kwargs): + super().__init__(**kwargs) + if not self.shared_state: + self.shared_state = SharedState() + class ToolConfig: strict: bool = False