tool_retriever
autogen.agentchat.contrib.captainagent.tool_retriever.LocalExecutorWithTools
LocalExecutorWithTools
An executor that executes code blocks with injected tools. In this executor, the func within the tools can be called directly without declaring in the code block.
For example, for a tool converted from langchain, the relevant functions can be called directly.
In this case, the wikipedia
function can be called directly in the code block. This hides the complexity of the tool.
Name | Description |
---|---|
tools | Type: list[Tool]Â |Â None Default: None |
work_dir | Type: pathlib.Path | str Default: PosixPath(’.’) |
Instance Attributes
code_extractor
(Experimental) Export a code extractor that can be used by an agent.
Instance Methods
execute_code_blocks
Execute code blocks and return the result.
Name | Description |
---|---|
code_blocks | The code blocks to execute. Type: list[CodeBlock] |
Type | Description |
---|---|
CodeResult | CodeResult: The result of the code execution. |
restart
Restart the code executor. Since this executor is stateless, no action is needed.