Skip to content

contextvars_utils

with_contextvars(wrapped)

Source code in griptape/utils/contextvars_utils.py
6
7
8
9
def with_contextvars(wrapped: Callable) -> Callable:
    ctx = contextvars.copy_context()

    return functools.partial(ctx.run, wrapped)