Ryzenth 1.8.7__py3-none-any.whl → 1.8.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Ryzenth/__version__.py CHANGED
@@ -1,4 +1,4 @@
1
- __version__ = "1.8.7"
1
+ __version__ = "1.8.9"
2
2
  __author__ = "TeamKillerX"
3
3
  __title__ = "Ryzenth"
4
4
  __description__ = "Ryzenth Python API Wrapper"
Ryzenth/_asynchisded.py CHANGED
@@ -22,6 +22,8 @@ import logging
22
22
  import httpx
23
23
  from box import Box
24
24
 
25
+ from Ryzenth._errors import WhatFuckError
26
+ from Ryzenth.helper import FbanAsync, ImagesAsync, ModeratorAsync, WhatAsync, WhisperAsync
25
27
  from Ryzenth.types import DownloaderBy, QueryParameter
26
28
 
27
29
  LOGS = logging.getLogger("[Ryzenth] async")
@@ -31,40 +33,14 @@ class RyzenthXAsync:
31
33
  self.api_key = api_key
32
34
  self.base_url = base_url.rstrip("/")
33
35
  self.headers = {"x-api-key": self.api_key}
34
- self.images = self.ImagesAsync(self)
35
- self.what = self.WhatAsync(self)
36
+ self.timeout = 10
37
+ self.images = ImagesAsync(self)
38
+ self.what = WhatAsync(self)
39
+ self.openai_audio = WhisperAsync(self)
40
+ self.federation = FbanAsync(self)
41
+ self.moderator = ModeratorAsync(self)
36
42
  self.obj = Box
37
43
 
38
- class WhatAsync:
39
- def __init__(self, parent):
40
- self.parent = parent
41
-
42
- async def think(self, params: QueryParameter, dot_access=False):
43
- url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
44
- async with httpx.AsyncClient() as client:
45
- try:
46
- response = await client.get(url, params=params.dict(), headers=self.parent.headers, timeout=30)
47
- response.raise_for_status()
48
- return self.parent.obj(response.json() or {}) if dot_access else response.json()
49
- except httpx.HTTPError as e:
50
- LOGS.error(f"[ASYNC] Error: {str(e)}")
51
- return None
52
-
53
- class ImagesAsync:
54
- def __init__(self, parent):
55
- self.parent = parent
56
-
57
- async def generate(self, params: QueryParameter):
58
- url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
59
- async with httpx.AsyncClient() as client:
60
- try:
61
- response = await client.get(url, params=params.dict(), headers=self.parent.headers, timeout=30)
62
- response.raise_for_status()
63
- return response.content
64
- except httpx.HTTPError as e:
65
- LOGS.error(f"[ASYNC] Error: {str(e)}")
66
- return None
67
-
68
44
  async def send_downloader(
69
45
  self,
70
46
  switch_name: str = None,
@@ -103,13 +79,13 @@ class RyzenthXAsync:
103
79
  f"{self.base_url}/v1/dl/{model_name}",
104
80
  params=params.dict(),
105
81
  headers=self.headers,
106
- timeout=10
82
+ timeout=self.timeout
107
83
  )
108
84
  response.raise_for_status()
109
85
  return self.obj(response.json() or {}) if dot_access else response.json()
110
86
  except httpx.HTTPError as e:
111
87
  LOGS.error(f"[ASYNC] Error: {str(e)}")
112
- return None
88
+ raise WhatFuckError("[ASYNC] Error fetching") from e
113
89
 
114
90
  async def send_message(
115
91
  self,
@@ -146,10 +122,10 @@ class RyzenthXAsync:
146
122
  f"{self.base_url}/v1/ai/akenox/{model_param}",
147
123
  params=params.dict(),
148
124
  headers=self.headers,
149
- timeout=10
125
+ timeout=self.timeout
150
126
  )
151
127
  response.raise_for_status()
152
128
  return self.obj(response.json() or {}) if dot_access else response.json()
153
129
  except httpx.HTTPError as e:
154
130
  LOGS.error(f"[ASYNC] Error: {str(e)}")
155
- return None
131
+ raise WhatFuckError("[ASYNC] Error fetching") from e
Ryzenth/_errors.py ADDED
@@ -0,0 +1,6 @@
1
+ class WhatFuckError(Exception):
2
+ pass
3
+
4
+ __all__ = [
5
+ "WhatFuckError"
6
+ ]
Ryzenth/_synchisded.py CHANGED
@@ -22,6 +22,8 @@ import logging
22
22
  import httpx
23
23
  from box import Box
24
24
 
25
+ from Ryzenth._errors import WhatFuckError
26
+ from Ryzenth.helper import FbanSync, ImagesSync, ModeratorSync, WhatSync, WhisperSync
25
27
  from Ryzenth.types import DownloaderBy, QueryParameter
26
28
 
27
29
  LOGS = logging.getLogger("[Ryzenth] sync")
@@ -31,48 +33,14 @@ class RyzenthXSync:
31
33
  self.api_key = api_key
32
34
  self.base_url = base_url.rstrip("/")
33
35
  self.headers = {"x-api-key": self.api_key}
34
- self.images = self.ImagesSync(self)
35
- self.what = self.WhatSync(self)
36
+ self.timeout = 10
37
+ self.images = ImagesSync(self)
38
+ self.what = WhatSync(self)
39
+ self.openai_audio = WhisperSync(self)
40
+ self.federation = FbanSync(self)
41
+ self.moderator = ModeratorSync(self)
36
42
  self.obj = Box
37
43
 
38
- class WhatSync:
39
- def __init__(self, parent):
40
- self.parent = parent
41
-
42
- def think(self, params: QueryParameter, dot_access=False):
43
- url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
44
- try:
45
- response = httpx.get(
46
- url,
47
- params=params.dict(),
48
- headers=self.parent.headers,
49
- timeout=30
50
- )
51
- response.raise_for_status()
52
- return self.parent.obj(response.json() or {}) if dot_access else response.json()
53
- except httpx.HTTPError as e:
54
- LOGS.error(f"[SYNC] Error fetching from deepseek {e}")
55
- return None
56
-
57
- class ImagesSync:
58
- def __init__(self, parent):
59
- self.parent = parent
60
-
61
- def generate(self, params: QueryParameter):
62
- url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
63
- try:
64
- response = httpx.get(
65
- url,
66
- params=params.dict(),
67
- headers=self.parent.headers,
68
- timeout=30
69
- )
70
- response.raise_for_status()
71
- return response.content
72
- except httpx.HTTPError as e:
73
- LOGS.error(f"[SYNC] Error fetching from images {e}")
74
- return None
75
-
76
44
  def send_downloader(
77
45
  self,
78
46
  switch_name: str = None,
@@ -109,13 +77,13 @@ class RyzenthXSync:
109
77
  f"{self.base_url}/v1/dl/{model_name}",
110
78
  params=params.dict(),
111
79
  headers=self.headers,
112
- timeout=10
80
+ timeout=self.timeout
113
81
  )
114
82
  response.raise_for_status()
115
83
  return self.obj(response.json() or {}) if dot_access else response.json()
116
84
  except httpx.HTTPError as e:
117
85
  LOGS.error(f"[SYNC] Error fetching from downloader {e}")
118
- return None
86
+ raise WhatFuckError("[SYNC] Error fetching from downloader") from e
119
87
 
120
88
  def send_message(
121
89
  self,
@@ -151,10 +119,10 @@ class RyzenthXSync:
151
119
  f"{self.base_url}/v1/ai/akenox/{model_param}",
152
120
  params=params.dict(),
153
121
  headers=self.headers,
154
- timeout=10
122
+ timeout=self.timeout
155
123
  )
156
124
  response.raise_for_status()
157
125
  return self.obj(response.json() or {}) if dot_access else response.json()
158
126
  except httpx.HTTPError as e:
159
127
  LOGS.error(f"[SYNC] Error fetching from akenox: {e}")
160
- return None
128
+ raise WhatFuckError("[SYNC] Error fetching from akenox") from e
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
+ #
5
+ # from : https://github.com/TeamKillerX
6
+ # Channel : @RendyProjects
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+
20
+ from ._federation import FbanAsync, FbanSync
21
+ from ._images import ImagesAsync, ImagesSync
22
+ from ._moderator import ModeratorAsync, ModeratorSync
23
+ from ._openai import WhisperAsync, WhisperSync
24
+ from ._thinking import WhatAsync, WhatSync
25
+
26
+ __all__ = [
27
+ "WhisperAsync",
28
+ "WhisperSync",
29
+ "ImagesAsync",
30
+ "ImagesSync",
31
+ "WhatAsync",
32
+ "WhatSync",
33
+ "FbanAsync",
34
+ "FbanSync",
35
+ "ModeratorAsync",
36
+ "ModeratorSync",
37
+ ]
@@ -0,0 +1,307 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
+ #
5
+ # from : https://github.com/TeamKillerX
6
+ # Channel : @RendyProjects
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+
20
+ import logging
21
+
22
+ import httpx
23
+
24
+ from Ryzenth._errors import WhatFuckError
25
+
26
+ LOGS = logging.getLogger("[Ryzenth]")
27
+
28
+ class FbanSync:
29
+ def __init__(self, parent):
30
+ self.parent = parent
31
+
32
+ def newfed(self, name: str , owner: int, dot_access=False):
33
+ url = f"{self.parent.base_url}/v2/federation/newfed"
34
+ try:
35
+ response = httpx.post(
36
+ url,
37
+ json={"name": name, "owner": owner},
38
+ headers=self.parent.headers,
39
+ timeout=self.parent.timeout
40
+ )
41
+ response.raise_for_status()
42
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
43
+ except httpx.HTTPError as e:
44
+ LOGS.error(f"[SYNC] Error fetching from newfed {e}")
45
+ raise WhatFuckError("[SYNC] Error fetching from newfed") from e
46
+
47
+ def subfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
48
+ url = f"{self.parent.base_url}/v2/federation/subfed"
49
+ try:
50
+ response = httpx.post(
51
+ url,
52
+ json={"parent_uuid": parent_uuid, "child_uuid": child_uuid},
53
+ headers=self.parent.headers,
54
+ timeout=self.parent.timeout
55
+ )
56
+ response.raise_for_status()
57
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
58
+ except httpx.HTTPError as e:
59
+ LOGS.error(f"[SYNC] Error fetching from subfed {e}")
60
+ raise WhatFuckError("[SYNC] Error fetching from subfed") from e
61
+
62
+ def getfed(self, uuid: str, dot_access=False):
63
+ url = f"{self.parent.base_url}/v2/federation/getfed/{uuid}"
64
+ try:
65
+ response = httpx.get(
66
+ url,
67
+ headers=self.parent.headers,
68
+ timeout=self.parent.timeout
69
+ )
70
+ response.raise_for_status()
71
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
72
+ except httpx.HTTPError as e:
73
+ LOGS.error(f"[SYNC] Error fetching from getfed {e}")
74
+ raise WhatFuckError("[SYNC] Error fetching from getfed") from e
75
+
76
+ def unban(self, name: str, user_id: int, dot_access=False):
77
+ url = f"{self.parent.base_url}/v2/federation/unban"
78
+ try:
79
+ response = httpx.post(
80
+ url,
81
+ json={"name": name, "user_id": user_id},
82
+ headers=self.parent.headers,
83
+ timeout=self.parent.timeout
84
+ )
85
+ response.raise_for_status()
86
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
87
+ except httpx.HTTPError as e:
88
+ LOGS.error(f"[SYNC] Error fetching from unban {e}")
89
+ raise WhatFuckError("[SYNC] Error fetching from unban") from e
90
+
91
+ def ban(self, federation_uuid: str, user_id: int, dot_access=False):
92
+ url = f"{self.parent.base_url}/v2/federation/ban"
93
+ try:
94
+ response = httpx.post(
95
+ url,
96
+ json={"federation_uuid": federation_uuid, "user_id": user_id},
97
+ headers=self.parent.headers,
98
+ timeout=self.parent.timeout
99
+ )
100
+ response.raise_for_status()
101
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
102
+ except httpx.HTTPError as e:
103
+ LOGS.error(f"[SYNC] Error fetching from unban {e}")
104
+ raise WhatFuckError("[SYNC] Error fetching from unban") from e
105
+
106
+ def ban_check(self, federation_uuid: str, user_id: int, dot_access=False):
107
+ url = f"{self.parent.base_url}/v2/federation/ban-check"
108
+ try:
109
+ response = httpx.post(
110
+ url,
111
+ json={"federation_uuid": federation_uuid, "user_id": user_id},
112
+ headers=self.parent.headers,
113
+ timeout=self.parent.timeout
114
+ )
115
+ response.raise_for_status()
116
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
117
+ except httpx.HTTPError as e:
118
+ LOGS.error(f"[SYNC] Error fetching from ban-check {e}")
119
+ raise WhatFuckError("[SYNC] Error fetching from ban-check") from e
120
+
121
+ def fedstats(self, uuid: str, dot_access=False):
122
+ url = f"{self.parent.base_url}/v2/federation/fedstats"
123
+ try:
124
+ response = httpx.get(
125
+ url,
126
+ params={"uuid": uuid},
127
+ headers=self.parent.headers,
128
+ timeout=self.parent.timeout
129
+ )
130
+ response.raise_for_status()
131
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
132
+ except httpx.HTTPError as e:
133
+ LOGS.error(f"[SYNC] Error fetching from fedstats {e}")
134
+ raise WhatFuckError("[SYNC] Error fetching from fedstats") from e
135
+
136
+ def unsubfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
137
+ url = f"{self.parent.base_url}/v2/federation/unsubfed"
138
+ try:
139
+ response = httpx.post(
140
+ url,
141
+ json={"parent_uuid": parent_uuid, "child_uuid": child_uuid},
142
+ headers=self.parent.headers,
143
+ timeout=self.parent.timeout
144
+ )
145
+ response.raise_for_status()
146
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
147
+ except httpx.HTTPError as e:
148
+ LOGS.error(f"[SYNC] Error fetching from unsubfed {e}")
149
+ raise WhatFuckError("[SYNC] Error fetching from unsubfed") from e
150
+
151
+ def renamefed(self, federation_uuid: str, new_name: str, dot_access=False):
152
+ url = f"{self.parent.base_url}/v2/federation/renamefed"
153
+ try:
154
+ response = httpx.post(
155
+ url,
156
+ json={"federation_uuid": federation_uuid, "new_name": new_name},
157
+ headers=self.parent.headers,
158
+ timeout=self.parent.timeout
159
+ )
160
+ response.raise_for_status()
161
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
162
+ except httpx.HTTPError as e:
163
+ LOGS.error(f"[SYNC] Error fetching from renamefed {e}")
164
+ raise WhatFuckError("[SYNC] Error fetching from renamefed") from e
165
+
166
+ class FbanAsync:
167
+ def __init__(self, parent):
168
+ self.parent = parent
169
+
170
+ async def newfed(self, name: str , owner: int, dot_access=False):
171
+ url = f"{self.parent.base_url}/v2/federation/newfed"
172
+ async with httpx.AsyncClient() as client:
173
+ try:
174
+ response = await client.post(
175
+ url,
176
+ json={"name": name, "owner": owner},
177
+ headers=self.parent.headers,
178
+ timeout=self.parent.timeout
179
+ )
180
+ response.raise_for_status()
181
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
182
+ except httpx.HTTPError as e:
183
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
184
+ raise WhatFuckError("[ASYNC] Error fetching") from e
185
+
186
+ async def subfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
187
+ url = f"{self.parent.base_url}/v2/federation/subfed"
188
+ async with httpx.AsyncClient() as client:
189
+ try:
190
+ response = await client.post(
191
+ url,
192
+ json={"parent_uuid": parent_uuid, "child_uuid": child_uuid},
193
+ headers=self.parent.headers,
194
+ timeout=self.parent.timeout
195
+ )
196
+ response.raise_for_status()
197
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
198
+ except httpx.HTTPError as e:
199
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
200
+ raise WhatFuckError("[ASYNC] Error fetching") from e
201
+
202
+ async def getfed(self, uuid: str, dot_access=False):
203
+ url = f"{self.parent.base_url}/v2/federation/getfed/{uuid}"
204
+ async with httpx.AsyncClient() as client:
205
+ try:
206
+ response = await client.get(url, headers=self.parent.headers, timeout=self.parent.timeout)
207
+ response.raise_for_status()
208
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
209
+ except httpx.HTTPError as e:
210
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
211
+ raise WhatFuckError("[ASYNC] Error fetching") from e
212
+
213
+ async def unban(self, name: str, user_id: int, dot_access=False):
214
+ url = f"{self.parent.base_url}/v2/federation/unban"
215
+ async with httpx.AsyncClient() as client:
216
+ try:
217
+ response = await client.post(
218
+ url,
219
+ json={"name": name, "user_id": user_id},
220
+ headers=self.parent.headers,
221
+ timeout=self.parent.timeout
222
+ )
223
+ response.raise_for_status()
224
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
225
+ except httpx.HTTPError as e:
226
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
227
+ raise WhatFuckError("[ASYNC] Error fetching") from e
228
+
229
+ async def ban(self, federation_uuid: str, user_id: int, dot_access=False):
230
+ url = f"{self.parent.base_url}/v2/federation/ban"
231
+ async with httpx.AsyncClient() as client:
232
+ try:
233
+ response = await client.post(
234
+ url,
235
+ json={"federation_uuid": federation_uuid, "user_id": user_id},
236
+ headers=self.parent.headers,
237
+ timeout=self.parent.timeout
238
+ )
239
+ response.raise_for_status()
240
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
241
+ except httpx.HTTPError as e:
242
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
243
+ raise WhatFuckError("[ASYNC] Error fetching") from e
244
+
245
+ async def ban_check(self, federation_uuid: str, user_id: int, dot_access=False):
246
+ url = f"{self.parent.base_url}/v2/federation/ban-check"
247
+ async with httpx.AsyncClient() as client:
248
+ try:
249
+ response = await client.post(
250
+ url,
251
+ json={"federation_uuid": federation_uuid, "user_id": user_id},
252
+ headers=self.parent.headers,
253
+ timeout=self.parent.timeout
254
+ )
255
+ response.raise_for_status()
256
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
257
+ except httpx.HTTPError as e:
258
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
259
+ raise WhatFuckError("[ASYNC] Error fetching") from e
260
+
261
+ async def fedstats(self, uuid: str, dot_access=False):
262
+ url = f"{self.parent.base_url}/v2/federation/fedstats"
263
+ async with httpx.AsyncClient() as client:
264
+ try:
265
+ response = await client.get(
266
+ url,
267
+ params={"uuid": uuid},
268
+ headers=self.parent.headers,
269
+ timeout=self.parent.timeout
270
+ )
271
+ response.raise_for_status()
272
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
273
+ except httpx.HTTPError as e:
274
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
275
+ raise WhatFuckError("[ASYNC] Error fetching") from e
276
+
277
+ async def unsubfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
278
+ url = f"{self.parent.base_url}/v2/federation/unsubfed"
279
+ async with httpx.AsyncClient() as client:
280
+ try:
281
+ response = await client.post(
282
+ url,
283
+ json={"parent_uuid": parent_uuid, "child_uuid": child_uuid},
284
+ headers=self.parent.headers,
285
+ timeout=self.parent.timeout
286
+ )
287
+ response.raise_for_status()
288
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
289
+ except httpx.HTTPError as e:
290
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
291
+ raise WhatFuckError("[ASYNC] Error fetching") from e
292
+
293
+ async def renamefed(self, federation_uuid: str, new_name: str, dot_access=False):
294
+ url = f"{self.parent.base_url}/v2/federation/renamefed"
295
+ async with httpx.AsyncClient() as client:
296
+ try:
297
+ response = await client.post(
298
+ url,
299
+ json={"federation_uuid": federation_uuid, "new_name": new_name},
300
+ headers=self.parent.headers,
301
+ timeout=self.parent.timeout
302
+ )
303
+ response.raise_for_status()
304
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
305
+ except httpx.HTTPError as e:
306
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
307
+ raise WhatFuckError("[ASYNC] Error fetching") from e
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
+ #
5
+ # from : https://github.com/TeamKillerX
6
+ # Channel : @RendyProjects
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+
20
+ import logging
21
+
22
+ import httpx
23
+
24
+ from Ryzenth._errors import WhatFuckError
25
+ from Ryzenth.types import QueryParameter
26
+
27
+ LOGS = logging.getLogger("[Ryzenth]")
28
+
29
+ class ImagesAsync:
30
+ def __init__(self, parent):
31
+ self.parent = parent
32
+
33
+ async def generate(self, params: QueryParameter):
34
+ url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
35
+ async with httpx.AsyncClient() as client:
36
+ try:
37
+ response = await client.get(url, params=params.dict(), headers=self.parent.headers, timeout=self.parent.timeout)
38
+ response.raise_for_status()
39
+ return response.content
40
+ except httpx.HTTPError as e:
41
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
42
+ raise WhatFuckError("[ASYNC] Error fetching") from e
43
+
44
+ class ImagesSync:
45
+ def __init__(self, parent):
46
+ self.parent = parent
47
+
48
+ def generate(self, params: QueryParameter):
49
+ url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
50
+ try:
51
+ response = httpx.get(
52
+ url,
53
+ params=params.dict(),
54
+ headers=self.parent.headers,
55
+ timeout=self.parent.timeout
56
+ )
57
+ response.raise_for_status()
58
+ return response.content
59
+ except httpx.HTTPError as e:
60
+ LOGS.error(f"[SYNC] Error fetching from images {e}")
61
+ raise WhatFuckError("[SYNC] Error fetching from images") from e
@@ -0,0 +1,125 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
+ #
5
+ # from : https://github.com/TeamKillerX
6
+ # Channel : @RendyProjects
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+
20
+ import json
21
+ import logging
22
+ from datetime import datetime as dt
23
+
24
+ import httpx
25
+
26
+ from Ryzenth._errors import WhatFuckError
27
+
28
+ LOGS = logging.getLogger("[Ryzenth]")
29
+
30
+ class ModeratorAsync:
31
+ def __init__(self, parent):
32
+ self.parent = parent
33
+
34
+ async def antievalai(
35
+ self,
36
+ query: str,
37
+ version: str,
38
+ to_dict_by_loads=False,
39
+ dot_access=False
40
+ ):
41
+ version_params = {
42
+ "v1": "v1",
43
+ "v2": "v2"
44
+ }
45
+ _version = version_params.get(version)
46
+ if not _version:
47
+ raise ValueError("Invalid Version Name")
48
+
49
+ url = f"{self.parent.base_url}/v1/ai/akenox/antievalai-{_version}"
50
+ async with httpx.AsyncClient() as client:
51
+ try:
52
+ response = await client.get(
53
+ url,
54
+ params={"query": query},
55
+ headers=self.parent.headers,
56
+ timeout=self.parent.timeout
57
+ )
58
+ response.raise_for_status()
59
+ if to_dict_by_loads:
60
+ try:
61
+ return {
62
+ "author": "TeamKillerX",
63
+ f"timestamps": dt.now(),
64
+ f"is_detect": json.loads(response.json()["results"])["is_detect"],
65
+ "source": "Powered by Ryzenth API"
66
+ }
67
+ except json.decoder.JSONDecodeError:
68
+ return {
69
+ "author": "TeamKillerX",
70
+ f"timestamps": dt.now(),
71
+ f"is_detect": False,
72
+ "source": "Powered by Ryzenth API"
73
+ }
74
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
75
+ except httpx.HTTPError as e:
76
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
77
+ raise WhatFuckError("[ASYNC] Error fetching") from e
78
+
79
+ class ModeratorSync:
80
+ def __init__(self, parent):
81
+ self.parent = parent
82
+
83
+ def antievalai(
84
+ self,
85
+ query: str,
86
+ version: str,
87
+ to_dict_by_loads=False,
88
+ dot_access=False
89
+ ):
90
+ version_params = {
91
+ "v1": "v1",
92
+ "v2": "v2"
93
+ }
94
+ _version = version_params.get(version)
95
+ if not _version:
96
+ raise ValueError("Invalid Version Name")
97
+
98
+ url = f"{self.parent.base_url}/v1/ai/akenox/antievalai-{_version}"
99
+ try:
100
+ response = httpx.get(
101
+ url,
102
+ params={"query": query},
103
+ headers=self.parent.headers,
104
+ timeout=self.parent.timeout
105
+ )
106
+ response.raise_for_status()
107
+ if to_dict_by_loads:
108
+ try:
109
+ return {
110
+ "author": "TeamKillerX",
111
+ f"timestamps": dt.now(),
112
+ f"is_detect": json.loads(response.json()["results"])["is_detect"],
113
+ "source": "Powered by Ryzenth API"
114
+ }
115
+ except json.decoder.JSONDecodeError:
116
+ return {
117
+ "author": "TeamKillerX",
118
+ f"timestamps": dt.now(),
119
+ f"is_detect": False,
120
+ "source": "Powered by Ryzenth API"
121
+ }
122
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
123
+ except httpx.HTTPError as e:
124
+ LOGS.error(f"[SYNC] Error fetching from antievalai {e}")
125
+ raise WhatFuckError("[SYNC] Error fetching from antievalai") from e
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
+ #
5
+ # from : https://github.com/TeamKillerX
6
+ # Channel : @RendyProjects
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+
20
+ import logging
21
+
22
+ import httpx
23
+
24
+ from Ryzenth._errors import WhatFuckError
25
+ from Ryzenth.types import OpenaiWhisper
26
+
27
+ LOGS = logging.getLogger("[Ryzenth]")
28
+
29
+ class WhisperAsync:
30
+ def __init__(self, parent):
31
+ self.parent = parent
32
+
33
+ async def whisper_from(self, params: OpenaiWhisper, dot_access=False):
34
+ url = f"{self.parent.base_url}/v1/ai/openai/whisper-large-v3-turbo"
35
+ async with httpx.AsyncClient() as client:
36
+ try:
37
+ response = await client.get(
38
+ url,
39
+ params=params.dict(),
40
+ headers=self.parent.headers,
41
+ timeout=self.parent.timeout
42
+ )
43
+ response.raise_for_status()
44
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
45
+ except httpx.HTTPError as e:
46
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
47
+ raise WhatFuckError("[ASYNC] Error fetching") from e
48
+
49
+ class WhisperSync:
50
+ def __init__(self, parent):
51
+ self.parent = parent
52
+
53
+ def whisper_from(self, params: OpenaiWhisper, dot_access=False):
54
+ url = f"{self.parent.base_url}/v1/ai/openai/whisper-large-v3-turbo"
55
+ try:
56
+ response = httpx.get(
57
+ url,
58
+ params=params.dict(),
59
+ headers=self.parent.headers,
60
+ timeout=self.parent.timeout
61
+ )
62
+ response.raise_for_status()
63
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
64
+ except httpx.HTTPError as e:
65
+ LOGS.error(f"[SYNC] Error fetching from whisper openai {e}")
66
+ raise WhatFuckError("[SYNC] Error fetching from whisper openai") from e
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+ # Copyright 2019-2025 (c) Randy W @xtdevs, @xtsea
4
+ #
5
+ # from : https://github.com/TeamKillerX
6
+ # Channel : @RendyProjects
7
+ # This program is free software: you can redistribute it and/or modify
8
+ # it under the terms of the GNU Affero General Public License as published by
9
+ # the Free Software Foundation, either version 3 of the License, or
10
+ # (at your option) any later version.
11
+ #
12
+ # This program is distributed in the hope that it will be useful,
13
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ # GNU Affero General Public License for more details.
16
+ #
17
+ # You should have received a copy of the GNU Affero General Public License
18
+ # along with this program. If not, see <https://www.gnu.org/licenses/>.
19
+
20
+ import logging
21
+
22
+ import httpx
23
+
24
+ from Ryzenth._errors import WhatFuckError
25
+ from Ryzenth.types import QueryParameter
26
+
27
+ LOGS = logging.getLogger("[Ryzenth]")
28
+
29
+ class WhatAsync:
30
+ def __init__(self, parent):
31
+ self.parent = parent
32
+
33
+ async def think(self, params: QueryParameter, dot_access=False):
34
+ url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
35
+ async with httpx.AsyncClient() as client:
36
+ try:
37
+ response = await client.get(
38
+ url,
39
+ params=params.dict(),
40
+ headers=self.parent.headers,
41
+ timeout=self.parent.timeout
42
+ )
43
+ response.raise_for_status()
44
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
45
+ except httpx.HTTPError as e:
46
+ LOGS.error(f"[ASYNC] Error: {str(e)}")
47
+ raise WhatFuckError("[ASYNC] Error fetching") from e
48
+
49
+ class WhatSync:
50
+ def __init__(self, parent):
51
+ self.parent = parent
52
+
53
+ def think(self, params: QueryParameter, dot_access=False):
54
+ url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
55
+ try:
56
+ response = httpx.get(
57
+ url,
58
+ params=params.dict(),
59
+ headers=self.parent.headers,
60
+ timeout=self.parent.timeout
61
+ )
62
+ response.raise_for_status()
63
+ return self.parent.obj(response.json() or {}) if dot_access else response.json()
64
+ except httpx.HTTPError as e:
65
+ LOGS.error(f"[SYNC] Error fetching from deepseek {e}")
66
+ raise WhatFuckError("[SYNC] Error fetching from deepseek") from e
Ryzenth/types/__init__.py CHANGED
@@ -28,3 +28,8 @@ class QueryParameter(BaseModel):
28
28
 
29
29
  class DownloaderBy(BaseModel):
30
30
  url: str
31
+
32
+ class OpenaiWhisper(BaseModel):
33
+ url: str
34
+ language: Optional[str] = None
35
+ task: Optional[str] = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Ryzenth
3
- Version: 1.8.7
3
+ Version: 1.8.9
4
4
  Summary: Ryzenth Python Wrapper For Perfomance
5
5
  Author: TeamKillerX
6
6
  License: MIT
@@ -0,0 +1,18 @@
1
+ Ryzenth/__init__.py,sha256=CKayGQJ_ZUZF6OHyL9kCdTah05BUikXKWKXL_raAgo8,937
2
+ Ryzenth/__version__.py,sha256=jPL75PTvp1TZbA0hDnWqpwC1hH1KuW3f2wqQZbVZgNM,118
3
+ Ryzenth/_asynchisded.py,sha256=pSbv0xKGrJ7oOupMP8fDS6TvWVnkwAc0ILaTOycy6So,4805
4
+ Ryzenth/_client.py,sha256=Y-I1ug8Hf2eF74oDY4eICOTP_nuLXdsDSkyZhpdqZy4,1475
5
+ Ryzenth/_errors.py,sha256=6JwvEAz7SHfJ_6-DkXzwyC5GrdzGr6FtbcIkaRYo9OQ,74
6
+ Ryzenth/_synchisded.py,sha256=LERIcwOWckaF2Tsae0wfjtgHe_yC41rCk1I08AVFpqY,4629
7
+ Ryzenth/helper/__init__.py,sha256=tmJJan2ZVtEy-GHxGwTWuYrP9iYugRuGLjQVnTApZU8,1236
8
+ Ryzenth/helper/_federation.py,sha256=VM1mkuPj4SvlO-VcazIV0T5Ga56RdcpDo7qybXwFCow,13946
9
+ Ryzenth/helper/_images.py,sha256=AfNQoxae-yI76PDUa-jx7tWBlJa4tRZQFDjeqBLKwVM,2309
10
+ Ryzenth/helper/_moderator.py,sha256=BCZ97DntbMaPmKKWZOPf0W9GjcxzwM2y1N9PqgRPT2w,4518
11
+ Ryzenth/helper/_openai.py,sha256=hUhmwxuKV-AAeEbDFm4RnkasHNJjFROLdw1q2j2t_Mc,2574
12
+ Ryzenth/helper/_thinking.py,sha256=BKHvQe16KPOGh7_vev-_Ed8jl6_77_8Ys-g0SDtvlSU,2557
13
+ Ryzenth/types/__init__.py,sha256=3eEOjoRcEPoE5J5oIhXEPH6vbYG7TLasTHFcbWGS-mU,1095
14
+ ryzenth-1.8.9.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
15
+ ryzenth-1.8.9.dist-info/METADATA,sha256=KZsmokursAmjhKiAl69cntqWRo3QzDotDEoLAcreJdU,4181
16
+ ryzenth-1.8.9.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
17
+ ryzenth-1.8.9.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
18
+ ryzenth-1.8.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- Ryzenth/__init__.py,sha256=CKayGQJ_ZUZF6OHyL9kCdTah05BUikXKWKXL_raAgo8,937
2
- Ryzenth/__version__.py,sha256=y3oVj4a94Xad01PaVSmZEY3iYLp5cn_eJ2km-fRTEbA,118
3
- Ryzenth/_asynchisded.py,sha256=ySUWEsx4V2lT93OiiPy7RvWHqVuYtm3ySno6ddJYFAM,5804
4
- Ryzenth/_client.py,sha256=Y-I1ug8Hf2eF74oDY4eICOTP_nuLXdsDSkyZhpdqZy4,1475
5
- Ryzenth/_synchisded.py,sha256=Et4yIWvsg8UH3_bXBNevnEQzYNkz6F8mj_0W-dQEFI0,5644
6
- Ryzenth/types/__init__.py,sha256=imnQqDE2egYlFm2_4DRjleLLkFTRthcdZChRBVJvjoc,983
7
- ryzenth-1.8.7.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
8
- ryzenth-1.8.7.dist-info/METADATA,sha256=fwGlfxqmVbex7WWCWaI9NbWU0PMEk0J-OFeO6tyN7i4,4181
9
- ryzenth-1.8.7.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
10
- ryzenth-1.8.7.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
11
- ryzenth-1.8.7.dist-info/RECORD,,