Skip to content

core: docstrings shouldn't inherit from parents #32066

@mdrxy

Description

@mdrxy
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

Metadata

Metadata

Assignees

Labels

coreRelated to the package `langchain-core`help wantedGood issue for contributorsv1Issue specific to LangChain 1.0

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions