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-coretracerslangchain
    Module●Since v0.1

    langchain

    A tracer implementation that records to LangChain endpoint.

    Attributes

    Functions

    Classes

    View source on GitHub
    attribute
    Run: RunTree
    attribute
    logger
    attribute
    OVERRIDABLE_LANGSMITH_INHERITABLE_METADATA_KEYS: frozenset[str]
    function
    get_runtime_environment
    function
    dumpd
    function
    add_usage
    function
    run_construct
    function
    run_to_dict
    function
    log_error_once
    function
    wait_for_all_tracers
    function
    get_client
    class
    UsageMetadata
    class
    BaseTracer
    class
    BaseMessage
    class
    ChatGenerationChunk
    class
    GenerationChunk
    class
    LangChainTracer

    Allowlist of LangSmith-only tracing metadata keys that bypass the default "first wins" merge semantics used when propagating tracer metadata to nested runs.

    Keys in this set are ALWAYS overridden by the nearest enclosing tracer config, so nested callers (e.g. a subagent) can replace a value inherited from an ancestor.

    Keep this list very small: every key here loses the default "first wins" protection and is always clobbered by the nearest enclosing tracer config. Only keys that are strictly for LangSmith tracing bookkeeping should be added.

    Get information about the LangChain runtime environment.

    Return a dict representation of an object.

    Recursively add two UsageMetadata objects.

    Construct run without validation, compatible with both Pydantic v1 and v2.

    Convert run to dict, compatible with both Pydantic v1 and v2.

    Log an error once.

    Wait for all tracers to finish.

    Get the client.

    Usage metadata for a message, such as token counts.

    This is a standard representation of token usage that is consistent across models.

    Base interface for tracers.

    Base abstract message class.

    Messages are the inputs and outputs of a chat model.

    Examples include HumanMessage, AIMessage, and SystemMessage.

    ChatGeneration chunk.

    ChatGeneration chunks can be concatenated with other ChatGeneration chunks.

    GenerationChunk, which can be concatenated with other Generation chunks.

    Implementation of the SharedTracer that POSTS to the LangChain endpoint.