diff --git a/agentops/decorators.py b/agentops/decorators.py index 49a9781a..e6976eb0 100644 --- a/agentops/decorators.py +++ b/agentops/decorators.py @@ -315,7 +315,7 @@ def decorator(obj): # Add descriptors for agent properties obj.agent_ops_agent_id = AgentOpsDescriptor("agent_id") obj.agent_ops_agent_name = AgentOpsDescriptor("agent_name") - + if name: obj._agentops_agent_name = name @@ -344,7 +344,7 @@ def new_init(self, *args, **kwargs): agent_id=self._agentops_agent_id, session=session, ) - except AttributeError as e: + except AttributeError: Client().add_pre_init_warning( f"Failed to track an agent {name} with the @track_agent decorator." ) @@ -358,8 +358,7 @@ def new_init(self, *args, **kwargs): elif inspect.isfunction(obj): obj._agentops_agent_id = str(uuid4()) Client().create_agent( - name=obj._agentops_agent_name, - agent_id=obj._agentops_agent_id + name=obj._agentops_agent_name, agent_id=obj._agentops_agent_id ) else: diff --git a/agentops/descriptor.py b/agentops/descriptor.py index e18fa806..e8433eff 100644 --- a/agentops/descriptor.py +++ b/agentops/descriptor.py @@ -48,7 +48,7 @@ def from_stack() -> Union[UUID, None]: if isinstance(agent_name_desc, AgentOpsDescriptor): agent_name = agent_name_desc.__get__(var, var_type) return agent_id - # elif + # elif except Exception as e: continue diff --git a/agentops/helpers.py b/agentops/helpers.py index e4cf6b0d..c61b5f99 100644 --- a/agentops/helpers.py +++ b/agentops/helpers.py @@ -13,8 +13,6 @@ from .log_config import logger - - def get_ISO_time(): """ Get the current UTC time in ISO 8601 format with milliseconds precision in UTC timezone.