From add5f140888bd92b7bf403614e288b97a4a1b96c Mon Sep 17 00:00:00 2001 From: TrueSaiyan Date: Sun, 21 Jan 2024 21:01:28 +0800 Subject: [PATCH 1/2] Update chatgpt.py --- RyuzakiLib/hackertools/chatgpt.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/RyuzakiLib/hackertools/chatgpt.py b/RyuzakiLib/hackertools/chatgpt.py index 6c6e732f..52b854fa 100644 --- a/RyuzakiLib/hackertools/chatgpt.py +++ b/RyuzakiLib/hackertools/chatgpt.py @@ -171,6 +171,8 @@ def _model_list(self, is_list_all=False): .get_response_turbo3(api_key=api_key, turbo3=True) .get_response_gemini_pro(api_key=api_key, re_json=True, is_gemini_pro=True) .get_response_google_ai(api_key=api_key, re_json=True, is_chat_bison=True, is_google=True) +.get_risma_image_generator(api_key=api_key, is_opendalle=True) +.get_risma_image_generator(api_key=api_key, is_dalle3xl=True) .multi_chat_response(api_key=api_key, is_multi_chat=True) ``` """ @@ -234,15 +236,22 @@ def get_response_google_ai( else: return f"WTF THIS {self.query}" - def get_risma_image_generator(self, api_key: str = None, is_opendalle: bool = False): - url = f"https://randydev-ryuzaki-api.hf.space/ryuzaki/opendalle" - headers = {"accept": "application/json", "api-key": api_key} - payload = {"query": self.query} - response = requests.post(url, headers=headers, json=payload) + def get_risma_image_generator(self, api_key: str = None, is_opendalle: bool = False, is_dalle3xl: bool = False): + if is_opendalle: + url = f"https://randydev-ryuzaki-api.hf.space/ryuzaki/opendalle" + headers = {"accept": "application/json", "api-key": api_key} + payload = {"query": self.query} + response = requests.post(url, headers=headers, json=payload) + elif is_dalle3xl: + url = f"https://randydev-ryuzaki-api.hf.space/ryuzaki/dalle3xl" + headers = {"accept": "application/json", "api-key": api_key} + payload = {"query": self.query} + response = requests.post(url, headers=headers, json=payload) + if response.status_code != 200: return f"Error status: {response.status_code}" - if is_opendalle: + if is_opendalle or is_dalle3xl: return response.json() else: return response From 227af0d98155e0d3df85288690ccf9d3f202a10a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 13:02:11 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- RyuzakiLib/hackertools/chatgpt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RyuzakiLib/hackertools/chatgpt.py b/RyuzakiLib/hackertools/chatgpt.py index 52b854fa..1bbcc46c 100644 --- a/RyuzakiLib/hackertools/chatgpt.py +++ b/RyuzakiLib/hackertools/chatgpt.py @@ -247,7 +247,7 @@ def get_risma_image_generator(self, api_key: str = None, is_opendalle: bool = Fa headers = {"accept": "application/json", "api-key": api_key} payload = {"query": self.query} response = requests.post(url, headers=headers, json=payload) - + if response.status_code != 200: return f"Error status: {response.status_code}"