mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
1adaa3c662
This is a follow up to #18371. These are the changes: - New **Azure AI Services** toolkit and tools to replace those of **Azure Cognitive Services**. - Updated documentation for Microsoft platform. - The image analysis tool has been rewritten to use the new package `azure-ai-vision-imageanalysis`, doing a proper replacement of `azure-ai-vision`. These changes: - Update outdated naming from "Azure Cognitive Services" to "Azure AI Services". - Update documentation to use non-deprecated methods to create and use agents. - Removes need to depend on yanked python package (`azure-ai-vision`) There is one new dependency that is needed as a replacement to `azure-ai-vision`: - `azure-ai-vision-imageanalysis`. This is optional and declared within a function. There is a new `azure_ai_services.ipynb` notebook showing usage; Changes have been linted and formatted. I am leaving the actions of adding deprecation notices and future removal of Azure Cognitive Services up to the LangChain team, as I am not sure what the current practice around this is. --- If this PR makes it, my handle is @galo@mastodon.social --------- Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> Co-authored-by: Bagatur <baskaryan@gmail.com> Co-authored-by: ccurme <chester.curme@gmail.com>
49 lines
2.6 KiB
Python
49 lines
2.6 KiB
Python
"""**Toolkits** are sets of tools that can be used to interact with
|
|
various services and APIs.
|
|
"""
|
|
|
|
import importlib
|
|
from typing import Any
|
|
|
|
_module_lookup = {
|
|
"AINetworkToolkit": "langchain_community.agent_toolkits.ainetwork.toolkit",
|
|
"AmadeusToolkit": "langchain_community.agent_toolkits.amadeus.toolkit",
|
|
"AzureAiServicesToolkit": "langchain_community.agent_toolkits.azure_ai_services",
|
|
"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}")
|
|
|
|
|
|
__all__ = list(_module_lookup.keys())
|