2024-02-22 00:18:36 +00:00
|
|
|
"""**Toolkits** are sets of tools that can be used to interact with
|
|
|
|
various services and APIs.
|
2023-12-11 21:53:30 +00:00
|
|
|
"""
|
2024-03-28 03:19:02 +00:00
|
|
|
|
2024-03-09 01:54:28 +00:00
|
|
|
import importlib
|
2024-04-10 17:01:19 +00:00
|
|
|
from typing import TYPE_CHECKING, Any
|
|
|
|
|
|
|
|
if TYPE_CHECKING:
|
|
|
|
from langchain_community.agent_toolkits.ainetwork.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AINetworkToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.amadeus.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AmadeusToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.azure_ai_services import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AzureAiServicesToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.azure_cognitive_services import (
|
2024-04-30 17:13:48 +00:00
|
|
|
AzureCognitiveServicesToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
2024-04-29 15:51:43 +00:00
|
|
|
from langchain_community.agent_toolkits.cassandra_database.toolkit import (
|
|
|
|
CassandraDatabaseToolkit, # noqa: F401
|
|
|
|
)
|
2024-04-10 17:01:19 +00:00
|
|
|
from langchain_community.agent_toolkits.cogniswitch.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
CogniswitchToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.connery import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ConneryToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.file_management.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
FileManagementToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.gmail.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
GmailToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.jira.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
JiraToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.json.base import (
|
2024-04-30 17:13:48 +00:00
|
|
|
create_json_agent,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.json.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
JsonToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.multion.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
MultionToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.nasa.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NasaToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.nla.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
NLAToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.office365.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
O365Toolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.openapi.base import (
|
2024-04-30 17:13:48 +00:00
|
|
|
create_openapi_agent,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.openapi.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
OpenAPIToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.playwright.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
PlayWrightBrowserToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.polygon.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
PolygonToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.powerbi.base import (
|
2024-04-30 17:13:48 +00:00
|
|
|
create_pbi_agent,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.powerbi.chat_base import (
|
2024-04-30 17:13:48 +00:00
|
|
|
create_pbi_chat_agent,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.powerbi.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
PowerBIToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.slack.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SlackToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.spark_sql.base import (
|
2024-04-30 17:13:48 +00:00
|
|
|
create_spark_sql_agent,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.spark_sql.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SparkSQLToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.sql.base import (
|
2024-04-30 17:13:48 +00:00
|
|
|
create_sql_agent,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.sql.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SQLDatabaseToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.steam.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
SteamToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
from langchain_community.agent_toolkits.zapier.toolkit import (
|
2024-04-30 17:13:48 +00:00
|
|
|
ZapierToolkit,
|
2024-04-10 17:01:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
__all__ = [
|
|
|
|
"AINetworkToolkit",
|
|
|
|
"AmadeusToolkit",
|
|
|
|
"AzureAiServicesToolkit",
|
|
|
|
"AzureCognitiveServicesToolkit",
|
|
|
|
"CogniswitchToolkit",
|
|
|
|
"ConneryToolkit",
|
|
|
|
"FileManagementToolkit",
|
|
|
|
"GmailToolkit",
|
|
|
|
"JiraToolkit",
|
|
|
|
"JsonToolkit",
|
|
|
|
"MultionToolkit",
|
|
|
|
"NLAToolkit",
|
|
|
|
"NasaToolkit",
|
|
|
|
"O365Toolkit",
|
|
|
|
"OpenAPIToolkit",
|
|
|
|
"PlayWrightBrowserToolkit",
|
|
|
|
"PolygonToolkit",
|
|
|
|
"PowerBIToolkit",
|
|
|
|
"SQLDatabaseToolkit",
|
|
|
|
"SlackToolkit",
|
|
|
|
"SparkSQLToolkit",
|
|
|
|
"SteamToolkit",
|
|
|
|
"ZapierToolkit",
|
|
|
|
"create_json_agent",
|
|
|
|
"create_openapi_agent",
|
|
|
|
"create_pbi_agent",
|
|
|
|
"create_pbi_chat_agent",
|
|
|
|
"create_spark_sql_agent",
|
|
|
|
"create_sql_agent",
|
|
|
|
]
|
|
|
|
|
2023-12-11 21:53:30 +00:00
|
|
|
|
2024-03-09 01:54:28 +00:00
|
|
|
_module_lookup = {
|
|
|
|
"AINetworkToolkit": "langchain_community.agent_toolkits.ainetwork.toolkit",
|
|
|
|
"AmadeusToolkit": "langchain_community.agent_toolkits.amadeus.toolkit",
|
2024-03-28 03:19:02 +00:00
|
|
|
"AzureAiServicesToolkit": "langchain_community.agent_toolkits.azure_ai_services",
|
2024-03-09 01:54:28 +00:00
|
|
|
"AzureCognitiveServicesToolkit": "langchain_community.agent_toolkits.azure_cognitive_services", # noqa: E501
|
|
|
|
"CogniswitchToolkit": "langchain_community.agent_toolkits.cogniswitch.toolkit",
|
|
|
|
"ConneryToolkit": "langchain_community.agent_toolkits.connery",
|
|
|
|
"FileManagementToolkit": "langchain_community.agent_toolkits.file_management.toolkit", # noqa: E501
|
|
|
|
"GmailToolkit": "langchain_community.agent_toolkits.gmail.toolkit",
|
|
|
|
"JiraToolkit": "langchain_community.agent_toolkits.jira.toolkit",
|
|
|
|
"JsonToolkit": "langchain_community.agent_toolkits.json.toolkit",
|
|
|
|
"MultionToolkit": "langchain_community.agent_toolkits.multion.toolkit",
|
|
|
|
"NLAToolkit": "langchain_community.agent_toolkits.nla.toolkit",
|
|
|
|
"NasaToolkit": "langchain_community.agent_toolkits.nasa.toolkit",
|
|
|
|
"O365Toolkit": "langchain_community.agent_toolkits.office365.toolkit",
|
|
|
|
"OpenAPIToolkit": "langchain_community.agent_toolkits.openapi.toolkit",
|
|
|
|
"PlayWrightBrowserToolkit": "langchain_community.agent_toolkits.playwright.toolkit",
|
|
|
|
"PolygonToolkit": "langchain_community.agent_toolkits.polygon.toolkit",
|
|
|
|
"PowerBIToolkit": "langchain_community.agent_toolkits.powerbi.toolkit",
|
|
|
|
"SQLDatabaseToolkit": "langchain_community.agent_toolkits.sql.toolkit",
|
|
|
|
"SlackToolkit": "langchain_community.agent_toolkits.slack.toolkit",
|
|
|
|
"SparkSQLToolkit": "langchain_community.agent_toolkits.spark_sql.toolkit",
|
|
|
|
"SteamToolkit": "langchain_community.agent_toolkits.steam.toolkit",
|
|
|
|
"ZapierToolkit": "langchain_community.agent_toolkits.zapier.toolkit",
|
|
|
|
"create_json_agent": "langchain_community.agent_toolkits.json.base",
|
|
|
|
"create_openapi_agent": "langchain_community.agent_toolkits.openapi.base",
|
|
|
|
"create_pbi_agent": "langchain_community.agent_toolkits.powerbi.base",
|
|
|
|
"create_pbi_chat_agent": "langchain_community.agent_toolkits.powerbi.chat_base",
|
|
|
|
"create_spark_sql_agent": "langchain_community.agent_toolkits.spark_sql.base",
|
|
|
|
"create_sql_agent": "langchain_community.agent_toolkits.sql.base",
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def __getattr__(name: str) -> Any:
|
|
|
|
if name in _module_lookup:
|
|
|
|
module = importlib.import_module(_module_lookup[name])
|
|
|
|
return getattr(module, name)
|
|
|
|
raise AttributeError(f"module {__name__} has no attribute {name}")
|