_normalize_shell_command() — langchain Function Reference
Architecture documentation for the _normalize_shell_command() function in shell_tool.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD cd3a99ac_4203_742a_4ebe_94e38caddc16["_normalize_shell_command()"] 4e57a0ff_f1a5_e2e9_6949_569d7cd6d70a["ShellToolMiddleware"] cd3a99ac_4203_742a_4ebe_94e38caddc16 -->|defined in| 4e57a0ff_f1a5_e2e9_6949_569d7cd6d70a bb8cdf05_0b11_e3e7_3c28_2a6ae5bfecb9["__init__()"] bb8cdf05_0b11_e3e7_3c28_2a6ae5bfecb9 -->|calls| cd3a99ac_4203_742a_4ebe_94e38caddc16 style cd3a99ac_4203_742a_4ebe_94e38caddc16 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain_v1/langchain/agents/middleware/shell_tool.py lines 604–613
def _normalize_shell_command(
shell_command: Sequence[str] | str | None,
) -> tuple[str, ...]:
if shell_command is None:
return ("/bin/bash",)
normalized = (shell_command,) if isinstance(shell_command, str) else tuple(shell_command)
if not normalized:
msg = "Shell command must contain at least one argument."
raise ValueError(msg)
return normalized
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does _normalize_shell_command() do?
_normalize_shell_command() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py.
Where is _normalize_shell_command() defined?
_normalize_shell_command() is defined in libs/langchain_v1/langchain/agents/middleware/shell_tool.py at line 604.
What calls _normalize_shell_command()?
_normalize_shell_command() 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