langchain_core.callbacks.manager.BaseRunManager¶

class langchain_core.callbacks.manager.BaseRunManager(*, run_id: UUID, handlers: List[BaseCallbackHandler], inheritable_handlers: List[BaseCallbackHandler], parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, inheritable_tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, inheritable_metadata: Optional[Dict[str, Any]] = None)[source]¶

Base class for run manager (a bound callback manager).

Initialize the run manager.

Parameters
  • run_id (UUID) – The ID of the run.

  • handlers (List[BaseCallbackHandler]) – The list of handlers.

  • inheritable_handlers (List[BaseCallbackHandler]) – The list of inheritable handlers.

  • parent_run_id (UUID, optional) – The ID of the parent run. Defaults to None.

  • tags (Optional[List[str]]) – The list of tags.

  • inheritable_tags (Optional[List[str]]) – The list of inheritable tags.

  • metadata (Optional[Dict[str, Any]]) – The metadata.

  • inheritable_metadata (Optional[Dict[str, Any]]) – The inheritable metadata.

Methods

__init__(*, run_id, handlers, ...[, ...])

Initialize the run manager.

get_noop_manager()

Return a manager that doesn't perform any operations.

on_retry(retry_state, *, run_id[, parent_run_id])

Run on a retry event.

on_text(text, *, run_id[, parent_run_id])

Run on arbitrary text.

__init__(*, run_id: UUID, handlers: List[BaseCallbackHandler], inheritable_handlers: List[BaseCallbackHandler], parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, inheritable_tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, inheritable_metadata: Optional[Dict[str, Any]] = None) None[source]¶

Initialize the run manager.

Parameters
  • run_id (UUID) – The ID of the run.

  • handlers (List[BaseCallbackHandler]) – The list of handlers.

  • inheritable_handlers (List[BaseCallbackHandler]) – The list of inheritable handlers.

  • parent_run_id (UUID, optional) – The ID of the parent run. Defaults to None.

  • tags (Optional[List[str]]) – The list of tags.

  • inheritable_tags (Optional[List[str]]) – The list of inheritable tags.

  • metadata (Optional[Dict[str, Any]]) – The metadata.

  • inheritable_metadata (Optional[Dict[str, Any]]) – The inheritable metadata.

classmethod get_noop_manager() BRM[source]¶

Return a manager that doesn’t perform any operations.

Returns

The noop manager.

Return type

BaseRunManager

on_retry(retry_state: RetryCallState, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) Any¶

Run on a retry event.

on_text(text: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) Any¶

Run on arbitrary text.