LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Caches
    • Callbacks
    • Documents
    • Document loaders
    • Embeddings
    • Exceptions
    • Language models
    • Serialization
    • Output parsers
    • Prompts
    • Rate limiters
    • Retrievers
    • Runnables
    • Utilities
    • Vector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewCachesCallbacksDocumentsDocument loadersEmbeddingsExceptionsLanguage modelsSerializationOutput parsersPromptsRate limitersRetrieversRunnablesUtilitiesVector stores
    MCP Adapters
    Standard Tests
    Text Splitters
    Language
    Theme
    Pythonlangchain-coretracersbaseBaseTracer
    Class●Since v0.1

    BaseTracer

    Base interface for tracers.

    Copy
    BaseTracer(
      self,
      *,
      _schema_format: Literal['original', 'streaming_events', 'original+chat'] = 'original',
      **kwargs: Any = {}
    )

    Bases

    _TracerCoreBaseCallbackHandlerABC

    Methods

    method
    on_chat_model_start

    Start a trace for a chat model run.

    method
    on_llm_start

    Start a trace for an LLM run.

    method
    on_llm_new_token

    Run on new LLM token.

    Only available when streaming is enabled.

    method
    on_retry

    Run on retry.

    method
    on_llm_end

    End a trace for an LLM or chat model run.

    method
    on_llm_error

    Handle an error for an LLM run.

    method
    on_chain_start

    Start a trace for a chain run.

    method
    on_chain_end

    End a trace for a chain run.

    method
    on_chain_error

    Handle an error for a chain run.

    method
    on_tool_start

    Start a trace for a tool run.

    method
    on_tool_end

    End a trace for a tool run.

    method
    on_tool_error

    Handle an error for a tool run.

    method
    on_retriever_start

    Run when the Retriever starts running.

    method
    on_retriever_error

    Run when Retriever errors.

    method
    on_retriever_end

    Run when the Retriever ends running.

    Inherited fromBaseCallbackHandler

    Attributes

    Araise_error: bool
    —

    Whether to raise an error if an exception occurs.

    Arun_inline: bool
    —

    Whether to run the callback inline.

    Aignore_llm: bool
    —

    Whether to ignore LLM callbacks.

    Aignore_retry: bool
    —

    Whether to ignore retry callbacks.

    Aignore_chain: bool
    —

    Whether to ignore chain callbacks.

    Aignore_agent: bool
    —

    Whether to ignore agent callbacks.

    Aignore_retriever: bool
    —

    Whether to ignore retriever callbacks.

    Aignore_chat_model: bool
    —

    Whether to ignore chat model callbacks.

    Aignore_custom_event: bool
    —

    Ignore custom event.

    Inherited fromChainManagerMixin

    Methods

    Mon_agent_action
    —

    Run on agent action.

    Mon_agent_finish
    —

    Run on the agent end.

    Inherited fromRunManagerMixin

    Methods

    Mon_text
    —

    Run on an arbitrary text.

    Mon_custom_event
    —

    Override to define a handler for a custom event.

    View source on GitHub