Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
tool.py43 linesDownload Raw Back to requests
1from typing import TYPE_CHECKING, Any2 3from langchain_classic._api import create_importer4 5if TYPE_CHECKING:6    from langchain_community.tools import (7        BaseRequestsTool,8        RequestsDeleteTool,9        RequestsGetTool,10        RequestsPatchTool,11        RequestsPostTool,12        RequestsPutTool,13    )14 15# Create a way to dynamically look up deprecated imports.16# Used to consolidate logic for raising deprecation warnings and17# handling optional imports.18DEPRECATED_LOOKUP = {19    "BaseRequestsTool": "langchain_community.tools",20    "RequestsGetTool": "langchain_community.tools",21    "RequestsPostTool": "langchain_community.tools",22    "RequestsPatchTool": "langchain_community.tools",23    "RequestsPutTool": "langchain_community.tools",24    "RequestsDeleteTool": "langchain_community.tools",25}26 27_import_attribute = create_importer(__package__, deprecated_lookups=DEPRECATED_LOOKUP)28 29 30def __getattr__(name: str) -> Any:31    """Look up attributes dynamically."""32    return _import_attribute(name)33 34 35__all__ = [36    "BaseRequestsTool",37    "RequestsDeleteTool",38    "RequestsGetTool",39    "RequestsPatchTool",40    "RequestsPostTool",41    "RequestsPutTool",42]43 
codekingpro/portable-devtools · Team Ai