langchain-ai/langchain

core: docstrings shouldn't inherit from parents

Open

#32.066 aperta il 16 lug 2025

Vedi su GitHub
 (7 commenti) (0 reazioni) (1 assegnatario)Python (22.617 fork)batch import
corehelp wantedinternalv1

Metriche repository

Star
 (136.758 star)
Metriche merge PR
 (Merge medio 10g 2h) (288 PR mergiate in 30 g)

Descrizione

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

Guida contributor