register_configure_hook#

langchain_core.tracers.context.register_configure_hook(context_var: ContextVar[Any | None], inheritable: bool, handle_class: Type[BaseCallbackHandler] | None = None, env_var: str | None = None) None[source]#

Register a configure hook.

Parameters:
  • context_var (ContextVar[Optional[Any]]) – The context variable.

  • inheritable (bool) – Whether the context variable is inheritable.

  • handle_class (Optional[Type[BaseCallbackHandler]], optional) – The callback handler class. Defaults to None.

  • env_var (Optional[str], optional) – The environment variable. Defaults to None.

Raises:

ValueError – If env_var is set, handle_class must also be set to a non-None value.

Return type:

None