Home / Function/ _validate_docstring_args_against_annotations() — langchain Function Reference

_validate_docstring_args_against_annotations() — langchain Function Reference

Architecture documentation for the _validate_docstring_args_against_annotations() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  fb3bc5b8_42ae_d4d9_5379_496d34d8490f["_validate_docstring_args_against_annotations()"]
  80cebff4_efbd_4311_85e9_de0dc81a7eee["base.py"]
  fb3bc5b8_42ae_d4d9_5379_496d34d8490f -->|defined in| 80cebff4_efbd_4311_85e9_de0dc81a7eee
  1a23ba05_08c6_e278_462c_5ad74643f2c9["_infer_arg_descriptions()"]
  1a23ba05_08c6_e278_462c_5ad74643f2c9 -->|calls| fb3bc5b8_42ae_d4d9_5379_496d34d8490f
  style fb3bc5b8_42ae_d4d9_5379_496d34d8490f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tools/base.py lines 178–193

def _validate_docstring_args_against_annotations(
    arg_descriptions: dict, annotations: dict
) -> None:
    """Validate that docstring arguments match function annotations.

    Args:
        arg_descriptions: Arguments described in the docstring.
        annotations: Type annotations from the function signature.

    Raises:
        ValueError: If a docstring argument is not found in function signature.
    """
    for docstring_arg in arg_descriptions:
        if docstring_arg not in annotations:
            msg = f"Arg {docstring_arg} in docstring not found in function signature."
            raise ValueError(msg)

Subdomains

Frequently Asked Questions

What does _validate_docstring_args_against_annotations() do?
_validate_docstring_args_against_annotations() is a function in the langchain codebase, defined in libs/core/langchain_core/tools/base.py.
Where is _validate_docstring_args_against_annotations() defined?
_validate_docstring_args_against_annotations() is defined in libs/core/langchain_core/tools/base.py at line 178.
What calls _validate_docstring_args_against_annotations()?
_validate_docstring_args_against_annotations() is called by 1 function(s): _infer_arg_descriptions.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free