mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-08 14:05:16 +00:00
Don't use dynamic api endpoint for Zapier NLA (#1803)
From Robert "Right now the dynamic/ route for specifically the above endpoints is acting on all providers a user has set up, not just the provider for the supplied API key."
This commit is contained in:
parent
8e5c4ac867
commit
04acda55ec
@ -38,7 +38,6 @@ class ZapierNLAWrapper(BaseModel):
|
|||||||
|
|
||||||
zapier_nla_api_key: str
|
zapier_nla_api_key: str
|
||||||
zapier_nla_api_base: str = "https://nla.zapier.com/api/v1/"
|
zapier_nla_api_base: str = "https://nla.zapier.com/api/v1/"
|
||||||
zapier_nla_api_dynamic_base: str = "https://nla.zapier.com/api/v1/dynamic/"
|
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
"""Configuration for this pydantic object."""
|
"""Configuration for this pydantic object."""
|
||||||
@ -101,7 +100,7 @@ class ZapierNLAWrapper(BaseModel):
|
|||||||
https://nla.zapier.com/api/v1/dynamic/docs)
|
https://nla.zapier.com/api/v1/dynamic/docs)
|
||||||
"""
|
"""
|
||||||
session = self._get_session()
|
session = self._get_session()
|
||||||
response = session.get(self.zapier_nla_api_dynamic_base + "exposed/")
|
response = session.get(self.zapier_nla_api_base + "exposed/")
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
return response.json()["results"]
|
return response.json()["results"]
|
||||||
|
|
||||||
@ -148,8 +147,8 @@ class ZapierNLAWrapper(BaseModel):
|
|||||||
data = self.preview(*args, **kwargs)
|
data = self.preview(*args, **kwargs)
|
||||||
return json.dumps(data)
|
return json.dumps(data)
|
||||||
|
|
||||||
def list_as_str(self, *args, **kwargs) -> str: # type: ignore[no-untyped-def]
|
def list_as_str(self) -> str: # type: ignore[no-untyped-def]
|
||||||
"""Same as list, but returns a stringified version of the JSON for
|
"""Same as list, but returns a stringified version of the JSON for
|
||||||
insertting back into an LLM."""
|
insertting back into an LLM."""
|
||||||
actions = self.list(*args, **kwargs)
|
actions = self.list()
|
||||||
return json.dumps(actions)
|
return json.dumps(actions)
|
||||||
|
Loading…
Reference in New Issue
Block a user