Profile API • AI Agents Framework
profile_api: Decorator to profile a function as an API call.
profile_api
Function
</div>
This function is defined in the profiler module.
Decorator to profile a function as an API call.
Signature
def profile_api(func: Optional[Callable]) -> AnyParameters
ParamField
Optional[Callable]No description available.
Returns
ResponseField
AnyThe result of the operation.
Usage
@profile_api(endpoint="openai/chat")
def call_openai():
passUses
Profiler.is_enabledfntime.perf_counterProfiler.record_api_callfunctools.wrapsdecorator
Source
View on GitHubpraisonai/profiler.py at line 1145