Home / Function/ _build_command() — langchain Function Reference

_build_command() — langchain Function Reference

Architecture documentation for the _build_command() function in _execution.py from the langchain codebase.

Function python LangChainCore Runnables calls 4 called by 2

Entity Profile

Dependency Diagram

graph TD
  e4dfd7ef_1e04_5414_759b_eeaddac35815["_build_command()"]
  270607fa_c99a_3911_2c2a_8e2c42ed30ef["CodexSandboxExecutionPolicy"]
  e4dfd7ef_1e04_5414_759b_eeaddac35815 -->|defined in| 270607fa_c99a_3911_2c2a_8e2c42ed30ef
  338d8d25_6ab3_9c8d_1642_bc64d57428eb["spawn()"]
  338d8d25_6ab3_9c8d_1642_bc64d57428eb -->|calls| e4dfd7ef_1e04_5414_759b_eeaddac35815
  0ca39ab6_f475_3199_9fda_998b3047cb82["_build_command()"]
  0ca39ab6_f475_3199_9fda_998b3047cb82 -->|calls| e4dfd7ef_1e04_5414_759b_eeaddac35815
  3e8d5e89_0a16_467a_a1cf_2c14a1472ea3["_resolve_binary()"]
  e4dfd7ef_1e04_5414_759b_eeaddac35815 -->|calls| 3e8d5e89_0a16_467a_a1cf_2c14a1472ea3
  86c76604_9ef0_684c_c50e_47b8e1363077["_determine_platform()"]
  e4dfd7ef_1e04_5414_759b_eeaddac35815 -->|calls| 86c76604_9ef0_684c_c50e_47b8e1363077
  94ee1582_75a2_cf18_d5c4_76e3e62ebf08["_format_override()"]
  e4dfd7ef_1e04_5414_759b_eeaddac35815 -->|calls| 94ee1582_75a2_cf18_d5c4_76e3e62ebf08
  0ca39ab6_f475_3199_9fda_998b3047cb82["_build_command()"]
  e4dfd7ef_1e04_5414_759b_eeaddac35815 -->|calls| 0ca39ab6_f475_3199_9fda_998b3047cb82
  style e4dfd7ef_1e04_5414_759b_eeaddac35815 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain_v1/langchain/agents/middleware/_execution.py lines 226–234

    def _build_command(self, command: Sequence[str]) -> list[str]:
        binary = self._resolve_binary()
        platform_arg = self._determine_platform()
        full_command: list[str] = [binary, "sandbox", platform_arg]
        for key, value in sorted(dict(self.config_overrides).items()):
            full_command.extend(["-c", f"{key}={self._format_override(value)}"])
        full_command.append("--")
        full_command.extend(command)
        return full_command

Domain

Subdomains

Frequently Asked Questions

What does _build_command() do?
_build_command() is a function in the langchain codebase, defined in libs/langchain_v1/langchain/agents/middleware/_execution.py.
Where is _build_command() defined?
_build_command() is defined in libs/langchain_v1/langchain/agents/middleware/_execution.py at line 226.
What does _build_command() call?
_build_command() calls 4 function(s): _build_command, _determine_platform, _format_override, _resolve_binary.
What calls _build_command()?
_build_command() is called by 2 function(s): _build_command, spawn.

Analyze Your Own Codebase

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

Try Supermodel Free