Add zapier deprecation warning (#12045)

Add zapier deprecation
This commit is contained in:
Eugene Yurtsev
2023-10-19 15:27:56 -04:00
committed by GitHub
parent 4188f046ec
commit 44d7763580
3 changed files with 43 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
"""Zapier Toolkit."""
"""[DEPRECATED] Zapier Toolkit."""
from typing import List
from langchain._api import warn_deprecated
from langchain.agents.agent_toolkits.base import BaseToolkit
from langchain.tools import BaseTool
from langchain.tools.zapier.tool import ZapierNLARunAction
@@ -48,4 +49,11 @@ class ZapierToolkit(BaseToolkit):
def get_tools(self) -> List[BaseTool]:
"""Get the tools in the toolkit."""
warn_deprecated(
since="0.0.319",
message=(
"This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details"
),
)
return self.tools

View File

@@ -1,4 +1,6 @@
"""## Zapier Natural Language Actions API
"""[DEPRECATED]
## Zapier Natural Language Actions API
\
Full docs here: https://nla.zapier.com/start/
@@ -79,6 +81,7 @@ agent.run(("Summarize the last email I received regarding Silicon Valley Bank. "
"""
from typing import Any, Dict, Optional
from langchain._api import warn_deprecated
from langchain.callbacks.manager import (
AsyncCallbackManagerForToolRun,
CallbackManagerForToolRun,
@@ -137,6 +140,13 @@ class ZapierNLARunAction(BaseTool):
self, instructions: str, run_manager: Optional[CallbackManagerForToolRun] = None
) -> str:
"""Use the Zapier NLA tool to return a list of all exposed user actions."""
warn_deprecated(
since="0.0.319",
message=(
"This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details"
),
)
return self.api_wrapper.run_as_str(self.action_id, instructions, self.params)
async def _arun(
@@ -145,6 +155,13 @@ class ZapierNLARunAction(BaseTool):
run_manager: Optional[AsyncCallbackManagerForToolRun] = None,
) -> str:
"""Use the Zapier NLA tool to return a list of all exposed user actions."""
warn_deprecated(
since="0.0.319",
message=(
"This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details"
),
)
return await self.api_wrapper.arun_as_str(
self.action_id,
instructions,
@@ -179,6 +196,13 @@ class ZapierNLAListActions(BaseTool):
run_manager: Optional[CallbackManagerForToolRun] = None,
) -> str:
"""Use the Zapier NLA tool to return a list of all exposed user actions."""
warn_deprecated(
since="0.0.319",
message=(
"This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details"
),
)
return self.api_wrapper.list_as_str()
async def _arun(
@@ -187,6 +211,13 @@ class ZapierNLAListActions(BaseTool):
run_manager: Optional[AsyncCallbackManagerForToolRun] = None,
) -> str:
"""Use the Zapier NLA tool to return a list of all exposed user actions."""
warn_deprecated(
since="0.0.319",
message=(
"This tool will be deprecated on 2023-11-17. See "
"https://nla.zapier.com/sunset/ for details"
),
)
return await self.api_wrapper.alist_as_str()