-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR aims to move all code with CVEs into `langchain.experimental`. Note that we are NOT yet removing from the core `langchain` package - we will give people a week to migrate here. See MIGRATE.md for how to migrate Zero changes to functionality Vulnerabilities this addresses: PALChain: - https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAIN-5752409 - https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAIN-5759265 SQLDatabaseChain - https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAIN-5759268 `load_prompt` (Python files only) - https://security.snyk.io/vuln/SNYK-PYTHON-LANGCHAIN-5725807
- Loading branch information
Showing
55 changed files
with
1,283 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Migrating to `langchain.experimental` | ||
|
||
We are moving any experimental components of langchain, or components with vulnerability issues, into `langchain.experimental`. | ||
This guide covers how to migrate. | ||
|
||
## Installation | ||
|
||
Previously: | ||
|
||
`pip install -U langchain` | ||
|
||
Now: | ||
|
||
`pip install -U langchain langchain.experimental` | ||
|
||
## PALChain | ||
|
||
Previously: | ||
|
||
`from langchain.chains import PALChain` | ||
|
||
Now: | ||
|
||
`from langchain.experimental.pal_chain import PALChain` | ||
|
||
## SQLDatabaseChain | ||
|
||
Previously: | ||
|
||
`from langchain.chains import SQLDatabaseChain` | ||
|
||
Now: | ||
|
||
`from langchain.experimental.sql import SQLDatabaseChain` | ||
|
||
## `load_prompt` for Python files | ||
|
||
Note: this only applies if you want to load Python files as prompts. | ||
If you want to load json/yaml files, no change is needed. | ||
|
||
Previously: | ||
|
||
`from langchain.prompts import load_prompt` | ||
|
||
Now: | ||
|
||
`from langchain.experimental.prompts import load_prompt` |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ental/autonomous_agents/autogpt/memory.py → ...ental/autonomous_agents/autogpt/memory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 2 additions & 1 deletion
3
...ental/autonomous_agents/autogpt/prompt.py → ...ental/autonomous_agents/autogpt/prompt.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...tonomous_agents/baby_agi/task_creation.py → ...tonomous_agents/baby_agi/task_creation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...onomous_agents/baby_agi/task_execution.py → ...onomous_agents/baby_agi/task_execution.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...us_agents/baby_agi/task_prioritization.py → ...us_agents/baby_agi/task_prioritization.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
libs/experimental/langchain/experimental/pal_chain/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"""Implements Program-Aided Language Models. | ||
As in https://arxiv.org/pdf/2211.10435.pdf. | ||
This is vulnerable to arbitrary code execution: | ||
https://github.com/hwchase17/langchain/issues/5872 | ||
""" | ||
from langchain.experimental.pal_chain.base import PALChain | ||
|
||
__all__ = ["PALChain"] |
Oops, something went wrong.