Human in the loop middleware.
HumanInTheLoopMiddleware(
self,
interrupt_on: dict[str, bool | InterruptOnConfig],
*,
description_prefix: str = 'Tool execution requires approval'
)| Name | Type | Description |
|---|---|---|
interrupt_on* | dict[str, bool | InterruptOnConfig] | Mapping of tool name to allowed actions. If a tool doesn't have an entry, it's auto-approved by default.
|
description_prefix | str | Default: 'Tool execution requires approval'The prefix to use when constructing action requests. This is used to provide context about the tool call and the action being requested. Not used if a tool has a |
| Name | Type |
|---|---|
| interrupt_on | dict[str, bool | InterruptOnConfig] |
| description_prefix | str |
Start the shell session and run startup commands.
Async start the shell session and run startup commands.
Check model call limits before making a model call.
Async check model call limits before making a model call.
Update the system message to include the todo system prompt.
Update the system message to include the todo system prompt.
Run shutdown commands and release resources when an agent completes.
Async run shutdown commands and release resources when an agent completes.
Intercept tool execution for retries, monitoring, or modification.
Intercept and control async tool execution via handler callback.