mirror of
https://github.com/hwchase17/langchain.git
synced 2025-05-12 02:26:23 +00:00
langchain[minor]: Re-add deleted ainetwork tool (#21254)
* Adding __init__.py to turn it into a package in community * Adding proxy imports that assume that langchain_community is optional
This commit is contained in:
parent
2fbe82f5e6
commit
0989c48028
30
libs/langchain/langchain/tools/ainetwork/app.py
Normal file
30
libs/langchain/langchain/tools/ainetwork/app.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from langchain_community.tools import AINAppOps
|
||||||
|
from langchain_community.tools.ainetwork.app import AppOperationType, AppSchema
|
||||||
|
|
||||||
|
# Create a way to dynamically look up deprecated imports.
|
||||||
|
# Used to consolidate logic for raising deprecation warnings and
|
||||||
|
# handling optional imports.
|
||||||
|
DEPRECATED_LOOKUP = {
|
||||||
|
"AppOperationType": "langchain_community.tools.ainetwork.app",
|
||||||
|
"AppSchema": "langchain_community.tools.ainetwork.app",
|
||||||
|
"AINAppOps": "langchain_community.tools",
|
||||||
|
}
|
||||||
|
|
||||||
|
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
"""Look up attributes dynamically."""
|
||||||
|
return _import_attribute(name)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"AppOperationType",
|
||||||
|
"AppSchema",
|
||||||
|
"AINAppOps",
|
||||||
|
]
|
27
libs/langchain/langchain/tools/ainetwork/base.py
Normal file
27
libs/langchain/langchain/tools/ainetwork/base.py
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from langchain_community.tools.ainetwork.base import AINBaseTool, OperationType
|
||||||
|
|
||||||
|
# Create a way to dynamically look up deprecated imports.
|
||||||
|
# Used to consolidate logic for raising deprecation warnings and
|
||||||
|
# handling optional imports.
|
||||||
|
DEPRECATED_LOOKUP = {
|
||||||
|
"OperationType": "langchain_community.tools.ainetwork.base",
|
||||||
|
"AINBaseTool": "langchain_community.tools.ainetwork.base",
|
||||||
|
}
|
||||||
|
|
||||||
|
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
"""Look up attributes dynamically."""
|
||||||
|
return _import_attribute(name)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"OperationType",
|
||||||
|
"AINBaseTool",
|
||||||
|
]
|
28
libs/langchain/langchain/tools/ainetwork/owner.py
Normal file
28
libs/langchain/langchain/tools/ainetwork/owner.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from langchain_community.tools import AINOwnerOps
|
||||||
|
from langchain_community.tools.ainetwork.owner import RuleSchema
|
||||||
|
|
||||||
|
# Create a way to dynamically look up deprecated imports.
|
||||||
|
# Used to consolidate logic for raising deprecation warnings and
|
||||||
|
# handling optional imports.
|
||||||
|
DEPRECATED_LOOKUP = {
|
||||||
|
"RuleSchema": "langchain_community.tools.ainetwork.owner",
|
||||||
|
"AINOwnerOps": "langchain_community.tools",
|
||||||
|
}
|
||||||
|
|
||||||
|
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
"""Look up attributes dynamically."""
|
||||||
|
return _import_attribute(name)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"RuleSchema",
|
||||||
|
"AINOwnerOps",
|
||||||
|
]
|
28
libs/langchain/langchain/tools/ainetwork/rule.py
Normal file
28
libs/langchain/langchain/tools/ainetwork/rule.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from langchain_community.tools import AINRuleOps
|
||||||
|
from langchain_community.tools.ainetwork.rule import RuleSchema
|
||||||
|
|
||||||
|
# Create a way to dynamically look up deprecated imports.
|
||||||
|
# Used to consolidate logic for raising deprecation warnings and
|
||||||
|
# handling optional imports.
|
||||||
|
DEPRECATED_LOOKUP = {
|
||||||
|
"RuleSchema": "langchain_community.tools.ainetwork.rule",
|
||||||
|
"AINRuleOps": "langchain_community.tools",
|
||||||
|
}
|
||||||
|
|
||||||
|
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
"""Look up attributes dynamically."""
|
||||||
|
return _import_attribute(name)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"RuleSchema",
|
||||||
|
"AINRuleOps",
|
||||||
|
]
|
28
libs/langchain/langchain/tools/ainetwork/transfer.py
Normal file
28
libs/langchain/langchain/tools/ainetwork/transfer.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from langchain_community.tools import AINTransfer
|
||||||
|
from langchain_community.tools.ainetwork.transfer import TransferSchema
|
||||||
|
|
||||||
|
# Create a way to dynamically look up deprecated imports.
|
||||||
|
# Used to consolidate logic for raising deprecation warnings and
|
||||||
|
# handling optional imports.
|
||||||
|
DEPRECATED_LOOKUP = {
|
||||||
|
"TransferSchema": "langchain_community.tools.ainetwork.transfer",
|
||||||
|
"AINTransfer": "langchain_community.tools",
|
||||||
|
}
|
||||||
|
|
||||||
|
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
"""Look up attributes dynamically."""
|
||||||
|
return _import_attribute(name)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"TransferSchema",
|
||||||
|
"AINTransfer",
|
||||||
|
]
|
28
libs/langchain/langchain/tools/ainetwork/value.py
Normal file
28
libs/langchain/langchain/tools/ainetwork/value.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
from langchain._api import create_importer
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from langchain_community.tools import AINValueOps
|
||||||
|
from langchain_community.tools.ainetwork.value import ValueSchema
|
||||||
|
|
||||||
|
# Create a way to dynamically look up deprecated imports.
|
||||||
|
# Used to consolidate logic for raising deprecation warnings and
|
||||||
|
# handling optional imports.
|
||||||
|
DEPRECATED_LOOKUP = {
|
||||||
|
"ValueSchema": "langchain_community.tools.ainetwork.value",
|
||||||
|
"AINValueOps": "langchain_community.tools",
|
||||||
|
}
|
||||||
|
|
||||||
|
_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)
|
||||||
|
|
||||||
|
|
||||||
|
def __getattr__(name: str) -> Any:
|
||||||
|
"""Look up attributes dynamically."""
|
||||||
|
return _import_attribute(name)
|
||||||
|
|
||||||
|
|
||||||
|
__all__ = [
|
||||||
|
"ValueSchema",
|
||||||
|
"AINValueOps",
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user