Skip to content

Commit 0dbe4fa

Browse files
committed
fix: Shared attribute values between class instances
1 parent 9fb312f commit 0dbe4fa

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

agent_tools/hooks.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ def intercept_response(self, event: AfterToolCallEvent):
7878

7979

8080
class ToolLoggingHook(HookProvider):
81-
agent_trace_id: UUID
82-
tools: dict[str, UUID]
83-
trace_id: UUID
84-
8581
def __init__(self, agent_trace_id: UUID, tools: dict[str, UUID]):
8682
"""Initializes the ToolLoggingHook.
8783
@@ -91,6 +87,7 @@ def __init__(self, agent_trace_id: UUID, tools: dict[str, UUID]):
9187
"""
9288
self.agent_trace_id = agent_trace_id
9389
self.tools = tools
90+
self.trace_id: UUID
9491

9592
@override
9693
def register_hooks(self, registry: HookRegistry, **kwargs) -> None:
@@ -147,14 +144,6 @@ def log_tool_response(self, event: AfterToolCallEvent) -> None:
147144

148145

149146
class AgentLoggingHook(HookProvider):
150-
parent_trace_id: UUID | None
151-
agent_id: UUID
152-
agent_trace_id: UUID
153-
invocation_state: dict
154-
messages: list[dict] = []
155-
is_gui_agent: bool = False
156-
created: bool = False
157-
158147
def __init__(
159148
self,
160149
agent_id: UUID,
@@ -177,6 +166,8 @@ def __init__(
177166
# We generate here the id for the agent trace so we can reference it outside
178167
self.agent_trace_id = uuid4()
179168
self.created = False
169+
self.messages: list[dict] = []
170+
self.created: bool = False
180171

181172
@override
182173
def register_hooks(self, registry: HookRegistry, **kwargs) -> None:

0 commit comments

Comments
 (0)