@@ -2963,6 +2963,29 @@ def delete_agent_run(self, agent_id: str, run_id: str) -> Dict:
29632963 """
29642964 return self ._make_request (requests .delete , f'/agents/{ agent_id } /runs/{ run_id } ' )
29652965
2966+ def get_agent_statistics (self , agent_id : str , * , after : Union [str , datetime ], before : Union [str , datetime ]) -> Dict :
2967+ """Get agent statistics, calls the GET /agents/{agentId}/statistics endpoint.
2968+
2969+ :param agent_id: Id of the agent
2970+ :type agent_id: str
2971+ :param after: Start time for statistics interval
2972+ :type after: str or datetime, optional
2973+ :param before: End time for statistics interval
2974+ :type before: str or datetime, optional
2975+ :return: Agent statistics response from REST API
2976+ :rtype: dict
2977+
2978+ :raises: :py:class:`~cradl.InvalidCredentialsException`, :py:class:`~cradl.TooManyRequestsException`,\
2979+ :py:class:`~cradl.LimitExceededException`, :py:class:`requests.exception.RequestException`
2980+ """
2981+ params = {
2982+ 'after' : datetimestr (after ),
2983+ 'before' : datetimestr (before ),
2984+ }
2985+
2986+ agent_statistics = self ._make_request (requests .get , f'/agents/{ agent_id } /statistics' , params = params )
2987+ return agent_statistics
2988+
29662989 def list_hooks (self , * , max_results : Optional [int ] = None , next_token : Optional [str ] = None ) -> Dict :
29672990 """List hooks available, calls the GET /hooks endpoint.
29682991
0 commit comments