aiq.profiler.decorators.function_tracking#
Functions#
|
Convert |
|
Serialize args and kwargs before calling the wrapped function. |
|
Push an intermediate step to the AIQ Toolkit Event Stream. |
|
Decorator that can wrap any type of function (sync, async, generator, |
Module Contents#
- _serialize_data(obj: Any) Any #
Convert
obj
into a structure that can be passed tojson.dumps(...)
.
- _prepare_serialized_args_kwargs(
- *args,
- **kwargs,
Serialize args and kwargs before calling the wrapped function.
- push_intermediate_step(
- step_manager: aiq.builder.intermediate_step_manager.IntermediateStepManager,
- identifier: str,
- function_name: str,
- event_type: aiq.data_models.intermediate_step.IntermediateStepType,
- args: Any = None,
- kwargs: Any = None,
- output: Any = None,
- metadata: dict[str, Any] | None = None,
Push an intermediate step to the AIQ Toolkit Event Stream.
- track_function( )#
Decorator that can wrap any type of function (sync, async, generator, async generator) and executes “tracking logic” around it.
If the function is async, it will be wrapped in an async function.
If the function is a generator, it will be wrapped in a generator function.
If the function is an async generator, it will be wrapped in an async generator function.
If the function is sync, it will be wrapped in a sync function.