MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / __init__

Method __init__

agentops/sdk/decorators/factory.py:58–66  ·  view source on GitHub ↗
(self, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

56 # For SpanKind.SESSION, this creates a span for __init__ or async context, not instance lifetime.
57 class WrappedClass(wrapped):
58 def __init__(self, *args: Any, **kwargs: Any):
59 op_name = name or wrapped.__name__
60 self._agentops_span_context_manager = _create_as_current_span(op_name, entity_kind, version)
61 self._agentops_active_span = self._agentops_span_context_manager.__enter__()
62 try:
63 _record_entity_input(self._agentops_active_span, args, kwargs)
64 except Exception as e:
65 logger.warning(f"Failed to record entity input for class {op_name}: {e}")
66 super().__init__(*args, **kwargs)
67
68 def __del__(self):
69 """Ensure span is properly ended when object is destroyed."""

Callers

nothing calls this directly

Calls 3

_create_as_current_spanFunction · 0.90
_record_entity_inputFunction · 0.90
__enter__Method · 0.45

Tested by

no test coverage detected