langchain-ai/langchain

core: docstrings shouldn't inherit from parents

Open

#32.066 aberto em 16 de jul. de 2025

Ver no GitHub
 (8 comments) (0 reactions) (1 assignee)Python (22.617 forks)batch import
corehelp wantedinternalv1

Métricas do repositório

Stars
 (136.758 stars)
Métricas de merge de PR
 (Mesclagem média 10d 2h) (288 fundiu PRs em 30d)

Description

from langchain_core.tools import tool
from pydantic import BaseModel


class MyTool(BaseModel):
    """Parent Tool"""
    foo: str

@tool
class ChildTool(MyTool):
    bar: str

For 0.4 release we could consider updating the behavior so that doc-strings are not inherited from their parents. It's fairly odd that doc-strings are inherited for BaseModels as in general the descriptions need to be different

Originally posted by @eyurtsev in #31606

Guia do colaborador