mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
Fix requests wrapper refactor (#2417)
https://github.com/hwchase17/langchain/pull/2367
This commit is contained in:
parent
41832042cc
commit
d6d6f322a9
@ -110,19 +110,19 @@ class TextRequestsWrapper(BaseModel):
|
|||||||
|
|
||||||
def post(self, url: str, data: Dict[str, Any], **kwargs: Any) -> str:
|
def post(self, url: str, data: Dict[str, Any], **kwargs: Any) -> str:
|
||||||
"""POST to the URL and return the text."""
|
"""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:
|
def patch(self, url: str, data: Dict[str, Any], **kwargs: Any) -> str:
|
||||||
"""PATCH the URL and return the text."""
|
"""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:
|
def put(self, url: str, data: Dict[str, Any], **kwargs: Any) -> str:
|
||||||
"""PUT the URL and return the text."""
|
"""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:
|
def delete(self, url: str, **kwargs: Any) -> str:
|
||||||
"""DELETE the URL and return the text."""
|
"""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:
|
async def aget(self, url: str, **kwargs: Any) -> str:
|
||||||
"""GET the URL and return the text asynchronously."""
|
"""GET the URL and return the text asynchronously."""
|
||||||
|
Loading…
Reference in New Issue
Block a user