mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
04c4878306
### **Description:** Previously `python_repl` was a built-in tool, but now it has been moved to `langchain_experimental`. When I use `load_tools` I get an error: ```python In [1]: from langchain.agents import load_tools In [2]: load_tools(["python_repl"]) --------------------------------------------------------------------------- ImportError Traceback (most recent call last) Cell In[2], line 1 ----> 1 load_tools(["python_repl"]) File ~/workspace/langchain/libs/langchain/langchain/agents/load_tools.py:530, in load_tools(tool_names, llm, callbacks, **kwargs) 528 tool_names.extend(requests_method_tools) 529 elif name in _BASE_TOOLS: --> 530 tools.append(_BASE_TOOLS[name]()) 531 elif name in _LLM_TOOLS: 532 if llm is None: File ~/workspace/langchain/libs/langchain/langchain/agents/load_tools.py:84, in _get_python_repl() 83 def _get_python_repl() -> BaseTool: ---> 84 raise ImportError( 85 "This tool has been moved to langchain experiment. " 86 "This tool has access to a python REPL. " 87 "For best practices make sure to sandbox this tool. " 88 "Read https://github.com/langchain-ai/langchain/blob/master/SECURITY.md " 89 "To keep using this code as is, install langchain experimental and " 90 "update relevant imports replacing 'langchain' with 'langchain_experimental'" 91 ) ImportError: This tool has been moved to langchain experiment. This tool has access to a python REPL. For best practices make sure to sandbox this tool. Read https://github.com/langchain-ai/langchain/blob/master/SECURITY.md To keep using this code as is, install langchain experimental and update relevant imports replacing 'langchain' with 'langchain_experimental' ``` In this case, it will be very confusing. I think it is no longer a built-in tool now, so it can be removed from `_BASE_TOOLS` ### **Issue:** https://github.com/langchain-ai/langchain/issues/13858, https://github.com/langchain-ai/langchain/issues/13859, https://github.com/langchain-ai/langchain/issues/13856 ### **Twitter handle:** [lin_bob57617](https://twitter.com/lin_bob57617) |
||
---|---|---|
.. | ||
cli | ||
core | ||
experimental | ||
langchain |