Generation utilities for decorators for automatic logging and instrumentation of functions and methods.
Name | Description |
---|---|
Optional[[Generation](/sdk/python/references/logger/components/generation)] | The current generation instance if one exists, |
Name | Type | Description |
---|---|---|
logger | Optional[Logger] | Maxim logger instance. If None, uses the current |
id
Optional[Union[Callable, str]] - Generation ID. Can be a string or a
callable that returns a string. If None, generates a UUID.name
Optional[str] - Human-readable name for the generation.maxim_prompt_id
Optional[str] - ID of the Maxim prompt template used.tags
Optional[Dict[str, str]] - Key-value pairs for tagging the generation.evaluators
Optional[List[str]] - List of evaluator names to run on this
generation.evaluator_variables
Optional[Dict[str, str]] - Variables to pass to
evaluators.Name | Description |
---|---|
Callable | The decorator function that wraps the target function. |
ValueError
- If no logger is found or if called outside of a trace/span context
when raise_exceptions is True.