Decorators
decorators.Retrieval
Retrieval utilities for decorators for automatic logging and instrumentation of functions and methods.
current_retrieval
Get the current retrieval from the context variable.
Returns:
Name | Description |
---|---|
Optional[[Retrieval](/sdk/python/references/logger/components/retrieval)] | The current retrieval instance if one exists, |
otherwise None.
retrieval
Decorator for tracking retrieval operations.
This decorator wraps functions to automatically create and manage Retrieval objects for tracking retrieval operations, including inputs, outputs, and metadata. The decorated function must be called within a @trace or @span decorated context.
Arguments:
Name | Type | Description |
---|---|---|
logger | Optional[Logger] | Maxim logger instance. If None, uses the current |
logger from context.
id
Optional[str] or Optional[Callable], optional - The ID for the retrieval. If callable, it will be called to generate the ID. Defaults to None.input
Optional[str] or Optional[Callable], optional - The input for the retrieval. If callable, it will be called to generate the input. Defaults to None.