Emulates specified tools using an LLM instead of executing them.
This middleware allows selective emulation of tools for testing purposes.
By default (when tools=None), all tools are emulated. You can specify which
tools to emulate by passing a list of tool names or BaseTool instances.
LLMToolEmulator(
self,
*,
tools: list[str | BaseTool] | None = None,
model: str | BaseChatModel | None = None
)| Name | Type | Description |
|---|---|---|
tools | list[str | BaseTool] | None | Default: NoneList of tool names ( If If empty list, no tools will be emulated. |
model | str | BaseChatModel | None | Default: NoneModel to use for emulation. Defaults to Can be a model identifier string or |
| Name | Type |
|---|---|
| tools | list[str | BaseTool] | None |
| model | str | BaseChatModel | None |
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.
Check for parallel write_todos tool calls and return errors if detected.
Check for parallel write_todos tool calls and return errors if detected.
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.