Closed as not planned
Description
Currently, mkdocstrings is unable to correctly parse pydantic's BaseModel. All class variables are recognized as required.
Example:
class BaseTool(BaseModel, ABC):
"""基础工具类,所有的类都要继承这个类
Args:
tool (Any): 工具,形式不限
tool_name (str, optional): 工具名称,默认输入为None,会自动获取工具名称
tool_description (str, optional): 工具描述,默认输入为None,会自动获取工具描述
tool_schema (Dict[str, Any], optional): 工具schema,默认输入为None,会自动获取工具schema
"""
tool: Any = Field(..., description="工具")
tool_name: Optional[str] = Field(default=None, description="工具名称")
tool_description: Optional[str] = Field(default=None, description="工具描述")
tool_schema: Optional[Dict[str, Any]] = Field(default=None,
description="工具schema")

Clearly, the three class variables tool_name
, tool_description
, and tool_schema
are not required, as they have a default value of None
. However, the parsing result incorrectly identifies them as required variables.