Run a single task non-interactively and exit.
When no shell_allow_list is configured, shell execution is disabled
and all other tool calls are auto-approved (no HITL prompts). When an
allow-list is provided, shell execution is enabled but gated by the
list; commands not in the list are rejected with an error message sent
back to the agent.
Note: _build_non_interactive_header makes a synchronous network call
to LangSmith (via fetch_langsmith_project_url) to resolve the thread
URL. This blocks the event loop briefly at startup.
run_non_interactive(
message: str,
assistant_id: str = 'agent',
model_name: str | None = None,
model_params: dict[str, Any] | None = None,
sandbox_type: str = 'none',
sandbox_id: str | None = None,
sandbox_setup: str | None = None,
*,
quiet: bool = False,
stream: bool = True
) -> int| Name | Type | Description |
|---|---|---|
message* | str | The task/message to execute. |
assistant_id | str | Default: 'agent'Agent identifier for memory storage. |
model_name | str | None | Default: NoneOptional model name to use. |
model_params | dict[str, Any] | None | Default: NoneExtra kwargs from These override config file values. |
sandbox_type | str | Default: 'none'Type of sandbox ( |
sandbox_id | str | None | Default: NoneOptional existing sandbox ID to reuse. |
sandbox_setup | str | None | Default: NoneOptional path to setup script to run in the sandbox after creation. |
quiet | bool | Default: FalseWhen |
stream | bool | Default: TrueWhen When |