agentchat.contrib.captainagent.tool_retriever
ToolBuilder
bind
Binds the function to the agent so that agent is aware of it.
bind_user_proxy
Updates user proxy agent with a executor so that code executor can successfully execute function-related code. Returns an updated user proxy.
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.
Arguments:
tools
- The tools to inject into the code execution environment. Default is an empty list.work_dir
- The working directory for the code execution. Default is the current directory.
code_extractor
(Experimental) Export a code extractor that can be used by an agent.
execute_code_blocks
Execute code blocks and return the result.
Arguments:
code_blocks
List[CodeBlock] - The code blocks to execute.
Returns:
CodeResult
- The result of the code execution.
restart
Restart the code executor. Since this executor is stateless, no action is needed.
get_full_tool_description
Retrieves the function signature for a given Python file.
find_callables
Find all callable objects defined in Python files within the specified directory.