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

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

Parameters

ParamField Optional[Callable]

No description available.

Returns

ResponseField Any

The result of the operation.

Usage

python
@profile_api(endpoint="openai/chat")
    def call_openai():
        pass

Uses

  • Profiler.is_enabled
  • fn
  • time.perf_counter
  • Profiler.record_api_call
  • functools.wraps
  • decorator

Source

View on GitHub

praisonai/profiler.py at line 1145


Related Documentation