Skip to content

Commit 0ef6957

Browse files
committed
fix ruff import err
1 parent a3851da commit 0ef6957

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

agentops/instrumentation/agentic/xpander/context.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def start_session(self, session_id: str, agent_info: Dict[str, Any], workflow_sp
3333
self._workflow_spans[session_id] = workflow_span
3434
if agent_span:
3535
self._agent_spans[session_id] = agent_span
36-
36+
3737
# Initialize conversation counter
3838
self._conversation_counters[session_id] = 0
3939

@@ -48,7 +48,7 @@ def end_conversation(self, session_id: str) -> None:
4848
with self._lock:
4949
if session_id in self._conversation_spans:
5050
del self._conversation_spans[session_id]
51-
51+
5252
def has_active_conversation(self, session_id: str) -> bool:
5353
"""Check if there's an active conversation for this session."""
5454
with self._lock:
@@ -88,25 +88,25 @@ def get_workflow_phase(self, session_id: str) -> str:
8888
"""Detect current workflow phase based on state."""
8989
with self._lock:
9090
session = self._sessions.get(session_id, {})
91-
92-
if session.get('tools_executed', []):
91+
92+
if session.get("tools_executed", []):
9393
return "executing"
94-
elif session.get('step_count', 0) > 0:
94+
elif session.get("step_count", 0) > 0:
9595
return "executing"
9696
else:
9797
return "planning"
98-
98+
9999
def get_workflow_span(self, session_id: str):
100100
"""Get the active workflow span for a session."""
101101
with self._lock:
102102
return self._workflow_spans.get(session_id)
103-
103+
104104
def get_agent_span(self, session_id: str):
105105
"""Get the active agent span for a session."""
106106
with self._lock:
107107
return self._agent_spans.get(session_id)
108-
108+
109109
def get_conversation_span(self, session_id: str):
110110
"""Get the active conversation span for a session."""
111111
with self._lock:
112-
return self._conversation_spans.get(session_id)
112+
return self._conversation_spans.get(session_id)

agentops/instrumentation/agentic/xpander/instrumentor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def wrapper(self, execution=None, input=None, **kwargs):
390390
elif execution is None:
391391
# Neither execution nor input provided - create empty execution
392392
execution = {}
393-
393+
394394
# Extract session ID and agent info
395395
session_id = instrumentor._extract_session_id(execution)
396396
agent_name = getattr(self, "name", "unknown")

examples/xpander/coding_agent.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Modified to use AgentOps callback handlers for tool instrumentation.
44
Single-file implementation combining MyAgent and XpanderEventListener.
55
"""
6+
# ruff: noqa: E402
67

78
import asyncio
89
import json

0 commit comments

Comments
 (0)