Python SDK for AI agent monitoring, LLM cost tracking, benchmarking, and more. Integrates with most LLMs and agent frameworks including CrewAI, Agno, OpenAI Agents SDK, Langchain, Autogen, AG2, and CamelAI
Python agentagentopsagents-sdkaianthropicautogencost-estimationcrewaievalsevaluation-metricsgroqlangchainllmmistralollamaopenaiopenai-agents
Refactor Agno token metrics (#1164)
Fenil Faldu593f99e9f60f
diff --git a/agentops/instrumentation/agentic/agno/instrumentor.py b/agentops/instrumentation/agentic/agno/instrumentor.pyindex 4e2cd44a..0707f5e5 100644--- a/agentops/instrumentation/agentic/agno/instrumentor.py+++ b/agentops/instrumentation/agentic/agno/instrumentor.py@@ -601,17 +601,7 @@ def create_metrics_wrapper(tracer, streaming_context_manager):for key, value in attributes.items():span.set_attribute(key, value)- # Execute the original function- result = wrapped(*args, **kwargs)-- # Set result attributes- result_attributes = get_metrics_attributes(args=(instance,) + args, kwargs=kwargs, return_value=result)- for key, value in result_attributes.items():- if key not in attributes: # Avoid duplicates- span.set_attribute(key, value)-span.set_status(Status(StatusCode.OK))- return resultexcept Exception as e:span.set_status(Status(StatusCode.ERROR, str(e)))