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

    attribute
    Run: RunTree
    attribute
    logger

    Functions

    function
    get_runtime_environment

    Get information about the LangChain runtime environment.

    function
    dumpd

    Return a dict representation of an object.

    function
    add_usage

    Recursively add two UsageMetadata objects.

    function
    run_construct

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

    function
    run_to_dict

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

    function
    log_error_once

    Log an error once.

    function
    wait_for_all_tracers

    Wait for all tracers to finish.

    function
    get_client

    Get the client.

    Classes

    class
    UsageMetadata

    Usage metadata for a message, such as token counts.

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

    class
    BaseTracer

    Base interface for tracers.

    class
    BaseMessage

    Base abstract message class.

    Messages are the inputs and outputs of a chat model.

    Examples include HumanMessage, AIMessage, and SystemMessage.

    class
    ChatGenerationChunk

    ChatGeneration chunk.

    ChatGeneration chunks can be concatenated with other ChatGeneration chunks.

    class
    GenerationChunk

    GenerationChunk, which can be concatenated with other Generation chunks.

    class
    LangChainTracer

    Implementation of the SharedTracer that POSTS to the LangChain endpoint.

    View source on GitHub