profile • AI Agents Framework

profile: Decorator to profile a function.

profile

Function

</div>

This function is defined in the profiler module.

Decorator to profile a function.

Signature

python
def profile(func: Optional[Callable]) -> Any

Parameters

ParamField Optional[Callable]

No description available.

Returns

ResponseField Any

The result of the operation.

Usage

python
@profile
    def my_function():
        pass

    @profile(category="api")
    def api_call():
        pass

Uses

  • Profiler.is_enabled
  • fn
  • time.time
  • Profiler.record_timing
  • Profiler.record_flow
  • functools.wraps
  • decorator

Source

View on GitHub

praisonai/profiler.py at line 986


Related Documentation