Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
Merge pull request #38 from ufoptg/patch-2
Browse files Browse the repository at this point in the history
Update chatgpt.py
  • Loading branch information
xtsea authored Jan 21, 2024
2 parents cf9b6a9 + 227af0d commit 8611188
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions RyuzakiLib/hackertools/chatgpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
```
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8611188

Please sign in to comment.