Skip to content

Commit e6e3377

Browse files
committed
Clean up
1 parent bf9c469 commit e6e3377

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

  • libraries/microsoft-agents-a365-observability-extensions-agentframework

libraries/microsoft-agents-a365-observability-extensions-agentframework/microsoft_agents_a365/observability/extensions/agentframework/span_processor.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@
77
from microsoft_agents_a365.observability.core.constants import (
88
GEN_AI_OPERATION_NAME_KEY,
99
EXECUTE_TOOL_OPERATION_NAME,
10-
GEN_AI_EVENT_CONTENT)
10+
GEN_AI_EVENT_CONTENT
11+
)
1112

1213

1314
class AgentFrameworkSpanProcessor(SpanProcessor):
1415
"""
1516
SpanProcessor for Agent Framework.
1617
"""
1718

19+
TOOL_CALL_RESULT_TAG = "gen_ai.tool.call.result"
20+
1821
def __init__(self, service_name: str | None = None):
1922
self.service_name = service_name
2023
super().__init__()
@@ -23,10 +26,9 @@ def on_start(self, span, parent_context):
2326
pass
2427

2528
def on_end(self, span, parent_context):
26-
TOOL_CALL_RESULT_TAG = "gen_ai.tool.call.result"
2729
if hasattr(span, "attributes"):
2830
operation_name = span.attributes.get(GEN_AI_OPERATION_NAME_KEY)
2931
if isinstance(operation_name, str) and operation_name == EXECUTE_TOOL_OPERATION_NAME:
30-
tool_call_result = span.attributes.get(TOOL_CALL_RESULT_TAG)
32+
tool_call_result = span.attributes.get(self.TOOL_CALL_RESULT_TAG)
3133
if tool_call_result is not None:
3234
span.set_attribute(GEN_AI_EVENT_CONTENT, tool_call_result)

libraries/microsoft-agents-a365-observability-extensions-agentframework/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
authors = [
99
{ name = "Microsoft", email = "support@microsoft.com" },
1010
]
11-
description = "Agent Framwork observability and tracing extensions for Microsoft Agents A365"
11+
description = "Agent Framework observability and tracing extensions for Microsoft Agents A365"
1212
readme = "README.md"
1313
requires-python = ">=3.11"
1414
classifiers = [

0 commit comments

Comments
 (0)