From d6d6f322a95dae0f7993a8a941ef6974c47a1443 Mon Sep 17 00:00:00 2001 From: jerwelborn Date: Tue, 4 Apr 2023 18:22:35 -0700 Subject: [PATCH] Fix requests wrapper refactor (#2417) https://github.com/hwchase17/langchain/pull/2367 --- langchain/requests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/langchain/requests.py b/langchain/requests.py index 97f29af6..6a3b33bf 100644 --- a/langchain/requests.py +++ b/langchain/requests.py @@ -110,19 +110,19 @@ class TextRequestsWrapper(BaseModel): def post(self, url: str, data: Dict[str, Any], **kwargs: Any) -> str: """POST to the URL and return the text.""" - return self.requests.post(url, json=data, headers=self.headers, **kwargs).text + return self.requests.post(url, data, **kwargs).text def patch(self, url: str, data: Dict[str, Any], **kwargs: Any) -> str: """PATCH the URL and return the text.""" - return self.requests.patch(url, json=data, headers=self.headers, **kwargs).text + return self.requests.patch(url, data, **kwargs).text def put(self, url: str, data: Dict[str, Any], **kwargs: Any) -> str: """PUT the URL and return the text.""" - return self.requests.put(url, json=data, headers=self.headers, **kwargs).text + return self.requests.put(url, data, **kwargs).text def delete(self, url: str, **kwargs: Any) -> str: """DELETE the URL and return the text.""" - return self.requests.delete(url, headers=self.headers, **kwargs).text + return self.requests.delete(url, **kwargs).text async def aget(self, url: str, **kwargs: Any) -> str: """GET the URL and return the text asynchronously."""