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

    file

    Callback handler that writes to a file.

    Functions

    function
    warn_deprecated

    Display a standardized deprecation.

    function
    print_text

    Print text with highlighting and no end characters.

    If a color is provided, the text will be printed in that color.

    If a file is provided, the text will be written to that file.

    Classes

    class
    BaseCallbackHandler

    Base callback handler.

    class
    AgentAction

    Represents a request to execute an action by an agent.

    The action consists of the name of the tool to execute and the input to pass to the tool. The log is used to pass along extra information about the action.

    class
    AgentFinish

    Final return value of an ActionAgent.

    Agents return an AgentFinish when they have reached a stopping condition.

    class
    FileCallbackHandler

    Callback handler that writes to a file.

    This handler supports both context manager usage (recommended) and direct instantiation (deprecated) for backwards compatibility.

    View source on GitHub