diff options
author | Raju Komati <komatiraju032@gmail.com> | 2023-04-29 11:38:10 +0200 |
---|---|---|
committer | Raju Komati <komatiraju032@gmail.com> | 2023-04-29 11:38:10 +0200 |
commit | c7f9f44f99f2e4a07867783af558252e3596892f (patch) | |
tree | 48828aa87d645ad04aaba2f3ba3384f2c1c2c2dc | |
parent | updated query methods in streamlit (diff) | |
download | gpt4free-c7f9f44f99f2e4a07867783af558252e3596892f.tar gpt4free-c7f9f44f99f2e4a07867783af558252e3596892f.tar.gz gpt4free-c7f9f44f99f2e4a07867783af558252e3596892f.tar.bz2 gpt4free-c7f9f44f99f2e4a07867783af558252e3596892f.tar.lz gpt4free-c7f9f44f99f2e4a07867783af558252e3596892f.tar.xz gpt4free-c7f9f44f99f2e4a07867783af558252e3596892f.tar.zst gpt4free-c7f9f44f99f2e4a07867783af558252e3596892f.zip |
-rw-r--r-- | gpt4free/forefront/typing.py | 2 | ||||
-rw-r--r-- | gpt4free/quora/__init__.py | 6 | ||||
-rw-r--r-- | gpt4free/quora/api.py | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/gpt4free/forefront/typing.py b/gpt4free/forefront/typing.py index d6026e04..23e90903 100644 --- a/gpt4free/forefront/typing.py +++ b/gpt4free/forefront/typing.py @@ -23,4 +23,4 @@ class ForeFrontResponse(BaseModel): model: str choices: List[Choice] usage: Usage - text: str
\ No newline at end of file + text: str diff --git a/gpt4free/quora/__init__.py b/gpt4free/quora/__init__.py index 31526e0c..f548ff41 100644 --- a/gpt4free/quora/__init__.py +++ b/gpt4free/quora/__init__.py @@ -377,10 +377,10 @@ class Poe: raise RuntimeError('Sorry, the model you provided does not exist. Please check and try again.') self.model = MODELS[model] self.cookie_path = cookie_path - self.cookie = self.__load_cookie(driver, download_driver, driver_path=driver_path) + self.cookie = self.__load_cookie(driver, driver_path=driver_path) self.client = PoeClient(self.cookie) - def __load_cookie(self, driver: str, download_driver: bool, driver_path: Optional[str] = None) -> str: + def __load_cookie(self, driver: str, driver_path: Optional[str] = None) -> str: if (cookie_file := Path(self.cookie_path)).exists(): with cookie_file.open() as fp: cookie = json.load(fp) @@ -468,4 +468,4 @@ class Poe: print(f'Successfully created bot with name: {response["bot"]["displayName"]}') def list_bots(self) -> list: - return list(self.client.bot_names.values())
\ No newline at end of file + return list(self.client.bot_names.values()) diff --git a/gpt4free/quora/api.py b/gpt4free/quora/api.py index 697f6663..c48eb273 100644 --- a/gpt4free/quora/api.py +++ b/gpt4free/quora/api.py @@ -225,7 +225,7 @@ class Client: r = request_with_retries(self.session.post, self.gql_url, data=payload, headers=headers) data = r.json() - if data["data"] == None: + if data["data"] is None: logger.warn(f'{query_name} returned an error: {data["errors"][0]["message"]} | Retrying ({i + 1}/20)') time.sleep(2) continue @@ -316,7 +316,7 @@ class Client: return # indicate that the response id is tied to the human message id - elif key != "pending" and value == None and message["state"] != "complete": + elif key != "pending" and value is None and message["state"] != "complete": self.active_messages[key] = message["messageId"] self.message_queues[key].put(message) return @@ -402,7 +402,7 @@ class Client: logger.info(f"Downloading {count} messages from {chatbot}") messages = [] - if cursor == None: + if cursor is None: chat_data = self.get_bot(self.bot_names[chatbot]) if not chat_data["messagesConnection"]["edges"]: return [] |