langchain_core.tracers.context.register_configure_hookΒΆ

langchain_core.tracers.context.register_configure_hook(context_var: ContextVar[Optional[Any]], inheritable: bool, handle_class: Optional[Type[BaseCallbackHandler]] = None, env_var: Optional[str] = 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.