Home / Function/ _normalize_commands() — langchain Function Reference

_normalize_commands() — langchain Function Reference

Architecture documentation for the _normalize_commands() function in shell_tool.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  9cd58e2d_78c3_3591_9799_a08e2aea6fd2["_normalize_commands()"]
  4e57a0ff_f1a5_e2e9_6949_569d7cd6d70a["ShellToolMiddleware"]
  9cd58e2d_78c3_3591_9799_a08e2aea6fd2 -->|defined in| 4e57a0ff_f1a5_e2e9_6949_569d7cd6d70a
  bb8cdf05_0b11_e3e7_3c28_2a6ae5bfecb9["__init__()"]
  bb8cdf05_0b11_e3e7_3c28_2a6ae5bfecb9 -->|calls| 9cd58e2d_78c3_3591_9799_a08e2aea6fd2
  style 9cd58e2d_78c3_3591_9799_a08e2aea6fd2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/shell_tool.py lines 594–601

    def _normalize_commands(
        commands: tuple[str, ...] | list[str] | str | None,
    ) -> tuple[str, ...]:
        if commands is None:
            return ()
        if isinstance(commands, str):
            return (commands,)
        return tuple(commands)

Domain

Subdomains

Called By

Frequently Asked Questions

What does _normalize_commands() do?
_normalize_commands() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py.
Where is _normalize_commands() defined?
_normalize_commands() is defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py at line 594.
What calls _normalize_commands()?
_normalize_commands() is called by 1 function(s): __init__.

Analyze Your Own Codebase

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

Try Supermodel Free