Home / Function/ render_text_description_and_args() — langchain Function Reference

render_text_description_and_args() — langchain Function Reference

Architecture documentation for the render_text_description_and_args() function in render.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  2dc2a63f_f0f3_4341_388c_2f9db5202709["render_text_description_and_args()"]
  f02b7602_69d7_9adf_ddea_892aea3802b0["render.py"]
  2dc2a63f_f0f3_4341_388c_2f9db5202709 -->|defined in| f02b7602_69d7_9adf_ddea_892aea3802b0
  style 2dc2a63f_f0f3_4341_388c_2f9db5202709 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/core/langchain_core/tools/render.py lines 41–67

def render_text_description_and_args(tools: list[BaseTool]) -> str:
    """Render the tool name, description, and args in plain text.

    Args:
        tools: The tools to render.

    Returns:
        The rendered text.

    Output will be in the format of:

    ```txt
    search: This tool is used for search, args: {"query": {"type": "string"}}
    calculator: This tool is used for math, \
    args: {"expression": {"type": "string"}}
    ```
    """
    tool_strings = []
    for tool in tools:
        args_schema = str(tool.args)
        if hasattr(tool, "func") and tool.func:
            sig = signature(tool.func)
            description = f"{tool.name}{sig} - {tool.description}"
        else:
            description = f"{tool.name} - {tool.description}"
        tool_strings.append(f"{description}, args: {args_schema}")
    return "\n".join(tool_strings)

Subdomains

Frequently Asked Questions

What does render_text_description_and_args() do?
render_text_description_and_args() is a function in the langchain codebase, defined in libs/core/langchain_core/tools/render.py.
Where is render_text_description_and_args() defined?
render_text_description_and_args() is defined in libs/core/langchain_core/tools/render.py at line 41.

Analyze Your Own Codebase

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

Try Supermodel Free