From 34fabc6cfc702a42f4f588e7eccae3d5e5ac7299 Mon Sep 17 00:00:00 2001 From: Atomie CHEN Date: Tue, 17 Dec 2024 23:48:55 +0800 Subject: [PATCH] fix(requestor): make params None if it's empty dict to prevent replacement (httpx #3433) httpx issue: When passing params={}, always strictly update rather than merge with an existing querystring. PR: https://github.com/encode/httpx/pull/3364 Issue: https://github.com/encode/httpx/issues/3433 --- src/handyllm/requestor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/handyllm/requestor.py b/src/handyllm/requestor.py index 4d3f57c..4c80318 100644 --- a/src/handyllm/requestor.py +++ b/src/handyllm/requestor.py @@ -251,7 +251,7 @@ def _call_raw(self) -> requests.Response: data=self.data, json=self.json_data, files=self.files, - params=self.params, + params=self.params or None, stream=self._stream, timeout=self.timeout, ) @@ -367,7 +367,7 @@ async def _acall_raw(self): data=self.data, json=self.json_data, files=self.files, - params=self.params, + params=self.params or None, timeout=self.timeout, ) response = await self._async_client.send(