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-coretoolsbaseBaseToolmodel_copy
    Methodā—Since v1.4

    model_copy

    Copy
    model_copy(
      self,
      *,
      update: Mapping[str, Any] | None = None,
      deep:
    View source on GitHub
    bool
    =
    False
    )
    ->
    Self

    Copy the tool, clearing the schema memo if update affects it.

    model_copy writes update directly to the copy's __dict__ without going through __setattr__, and private attributes (including the memo) carry over to the copy, so the memo is cleared here when the update touches one of the fields the schema is built from.