PythonRepl tools and Pandas/Xorbits/Spark/Python agents are moving to langchain_experimental #11680
Replies: 15 comments 17 replies
-
how can I use csv agent in langchain_experimental? |
Beta Was this translation helpful? Give feedback.
-
Python AST tool CVE was resolved here: #12427 And the fixes are released as of version 0.0.325: https://github.com/langchain-ai/langchain/releases/tag/v0.0.325 |
Beta Was this translation helpful? Give feedback.
-
When I try When I then try Any resolutions? |
Beta Was this translation helpful? Give feedback.
-
"from langchain.agents import create_csv_agent" I am try this , I get this |
Beta Was this translation helpful? Give feedback.
-
Hello, I fixed this by: pip install langchain_experimental then: the import was found in the agents init.py file. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your tremendous support!!! It's working... Thankyou
…On Tue, 31 Oct 2023 at 21:41, danieaneta ***@***.***> wrote:
Hello, I fixed this by:
*pip install langchain_experimental*
then:
*from langchain_experimental.agents.agent_toolkits.csv.base import
create_csv_agent*
the import was found in the agents *init*.py file.
—
Reply to this email directly, view it on GitHub
<#11680 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BA7AQVKIO42GK7K753Z3JULYCEPLHAVCNFSM6AAAAAA54TSUM2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TIMZXGE3DC>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
Is langchain_Experimental usable for projects ? I see this in pypi |
Beta Was this translation helpful? Give feedback.
-
@DebanjanBanerjeeQB It depends on how you want to use the code. It has code that might rely on the python ast repl without built in sandboxing, which if exposed to an end user could result in the execution of malicious code unless you take appropriate precautions Please review for guidelines: https://python.langchain.com/docs/security |
Beta Was this translation helpful? Give feedback.
-
Anything tips on which precautions I should take?
…________________________________
From: Eugene Yurtsev ***@***.***>
Sent: Monday, November 6, 2023 2:08:52 PM
To: langchain-ai/langchain ***@***.***>
Cc: Bruno Veras De Melo ***@***.***>; Comment ***@***.***>
Subject: Re: [langchain-ai/langchain] PythonRepl tools and Pandas/Xorbits/Spark/Python agents are moving to langchain_experimental (Discussion #11680)
***ATTENTION: This email came from an external source. Do not open attachments or click on links from unknown senders or unexpected emails.***
@DebanjanBanerjeeQB<https://github.com/DebanjanBanerjeeQB> It depends on how you want to use the code. It has code that might rely on the python ast repl without built in sandboxing, which if exposed to an end user could result in the execution of malicious code unless you take appropriate precautions
Please review for guidelines: https://python.langchain.com/docs/security
—
Reply to this email directly, view it on GitHub<#11680 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AWZHCJ5QHYNQJOIOV2HM4FDYDEYUJAVCNFSM6AAAAAA54TSUM2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TIOJRGIYTG>.
You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
im having issues when trying to use create_spark_dataframe_agent on azure databricks |
Beta Was this translation helpful? Give feedback.
-
How do i use pandas dataframe agent?I use the following code to import: But I get the error: "ImportError: create_pandas_dataframe_agent has been moved to langchain experimental. See https://github.com/langchain-ai/langchain/discussions/11680for more information. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
but why langchain keeps moving classes, packages,librariesall aound the place. deprecating some of them, renaming, removing altogether. this is annoying. for instance, lets say I am going through a tutorial recorded in Oct'23, most of the langchain imports dont work in Apr. in fact, even videos recorded in Jan gives problem. what is your intention, Langchain? |
Beta Was this translation helpful? Give feedback.
-
agree with you, Lysakowski, but not just agents doc a few other libraries
as well.
besides all the third party tutorials, sessions refer to old libraries and
classes. though this is not langchain community's fault, it is a total
mess, totally unorganised and so difficult to find the right library, class
or method to use
…On Wed, 22 May 2024 at 18:47, Rich Lysakowski ***@***.***> wrote:
The Agents documentation is a big mess. No examples ran from 6 months ago.
import pandas as pd
from langchain_openai import ChatOpenAI
from langchain_experimental.agents import create_csv_agent
from langchain_experimental.agents import AgentType
from langchain_experimental.agents.agent_toolkits.python.base import
create_python_agent
llm = OpenAI(model="gpt-3.5-turbo", temperature=0)
agent_executor = create_python_agent(
llm,
"books.csv",
AgentType = AgentType.ZERO_SHOT_REACT_DESCRIPTION,
verbose = True,
#prefix = "find the author who has most number of books published in year
2015"
)
print(agent_executor.invoke("find the author who has most number of books
published in year 2015"))
"""(langchain_tools)
C:\Users\PowerUser\Documents\Github_Repos_RSL\LLMtutorial_ronidas39\Tut_04>python
main_RSL_WIP.py
File
"C:\Users\PowerUser\Documents\Github_Repos_RSL\LLMtutorial_ronidas39\Tut_04\main_RSL_WIP.py",
line 54
^^^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in
position 21-22: truncated \UXXXXXXXX escape
(langchain_tools)
C:\Users\PowerUser\Documents\Github_Repos_RSL\LLMtutorial_ronidas39\Tut_04>python
main_RSL_WIP.py
Traceback (most recent call last):
File
"C:\Users\PowerUser\Documents\Github_Repos_RSL\LLMtutorial_ronidas39\Tut_04\main_RSL_WIP.py",
line 19, in
from langchain_experimental.agents import AgentType
ImportError: cannot import name 'AgentType' from
'langchain_experimental.agents'
(C:\ProgramData\Anaconda3\envs\langchain_tools\Lib\site-packages\langchain_experimental\agents_
*init*_.py)
"""
—
Reply to this email directly, view it on GitHub
<#11680 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALS6KGCRVAB2FAXMFXTW43LZDRZU3AVCNFSM6AAAAAA54TSUM2VHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TKMJZHE2TI>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
|
Beta Was this translation helpful? Give feedback.
-
from langchain.agents.agent_toolkits import create_python_agent this code is come from deeplearning.ai,but when I try to use on my computer,my ide return this error:ValueError Traceback (most recent call last) File :1406, in handle_fromlist(module, fromlist, import, recursive) File c:\Users\zzy\AppData\Local\Programs\Python\Python312\Lib\site-packages\langchain\agents\agent_toolkits_init_.py:121, in getattr(name) File c:\Users\zzy\AppData\Local\Programs\Python\Python312\Lib\site-packages\langchain_core_api\path.py:30, in as_import_path(file, suffix, relative_to) File c:\Users\zzy\AppData\Local\Programs\Python\Python312\Lib\site-packages\langchain_core_api\path.py:18, in get_relative_path(file, relative_to) ValueError: 'c:\Users\zzy\AppData\Local\Programs\Python\Python312\Lib\site-packages\langchain\agents\agent_toolkits' is not in the subpath of 'c:\Users\zzy\AppData\Local\Programs\Python\Python312\Lib\site-packages\langchain_core' |
Beta Was this translation helpful? Give feedback.
-
On 10/27/2023, we will moving additional code to langchain_experimental to
resolve the following CVE: https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAIN-5843727
This affects all code that relies on either
PythonAstREPLTool
orPythonREPLTool
, which includes:Agents: Pandas Agent, Xorbits Agent, Spark Agent, Python Agent
Toolkits: python
Tools: PythonREPLTool, PythonAstREPLTool
We will make the relevant code available in langchain_experimental shortly,
with final deprecation from langchain scheduled for 10/27/2023.
For more context please see: #8043
Beta Was this translation helpful? Give feedback.
All reactions