mirror of
https://github.com/hwchase17/langchain
synced 2024-11-02 09:40:22 +00:00
e6ebde9688
- **Description:** The experimental package needs to be compatible with the usage of importing agents For example, if i use `from langchain.agents import create_pandas_dataframe_agent`, running the program will prompt the following information: ``` Traceback (most recent call last): File "/Users/dongwm/test/main.py", line 1, in <module> from langchain.agents import create_pandas_dataframe_agent File "/Users/dongwm/test/venv/lib/python3.11/site-packages/langchain/agents/__init__.py", line 87, in __getattr__ raise ImportError( ImportError: create_pandas_dataframe_agent has been moved to langchain experimental. See https://github.com/langchain-ai/langchain/discussions/11680 for more information. Please update your import statement from: `langchain.agents.create_pandas_dataframe_agent` to `langchain_experimental.agents.create_pandas_dataframe_agent`. ``` But when I changed to `from langchain_experimental.agents import create_pandas_dataframe_agent`, it was actually wrong: ```python Traceback (most recent call last): File "/Users/dongwm/test/main.py", line 2, in <module> from langchain_experimental.agents import create_pandas_dataframe_agent ImportError: cannot import name 'create_pandas_dataframe_agent' from 'langchain_experimental.agents' (/Users/dongwm/test/venv/lib/python3.11/site-packages/langchain_experimental/agents/__init__.py) ``` I should use `from langchain_experimental.agents.agent_toolkits import create_pandas_dataframe_agent`. In order to solve the problem and make it compatible, I added additional import code to the langchain_experimental package. Now it can be like this Used `from langchain_experimental.agents import create_pandas_dataframe_agent` - **Twitter handle:** [lin_bob57617](https://twitter.com/lin_bob57617) |
||
---|---|---|
.. | ||
langchain_experimental | ||
tests | ||
Makefile | ||
poetry.lock | ||
poetry.toml | ||
pyproject.toml | ||
README.md |
🦜️🧪 LangChain Experimental
This package holds experimental LangChain code, intended for research and experimental uses.
Warning
Portions of the code in this package may be dangerous if not properly deployed in a sandboxed environment. Please be wary of deploying experimental code to production unless you've taken appropriate precautions and have already discussed it with your security team.
Some of the code here may be marked with security notices. However, given the exploratory and experimental nature of the code in this package, the lack of a security notice on a piece of code does not mean that the code in question does not require additional security considerations in order to be safe to use.