Ryzenth 1.8.8__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 +1 -1
- Ryzenth/_asynchisded.py +11 -37
- Ryzenth/_errors.py +6 -0
- Ryzenth/_synchisded.py +11 -45
- Ryzenth/helper/__init__.py +13 -1
- Ryzenth/helper/_federation.py +307 -0
- Ryzenth/helper/_images.py +61 -0
- Ryzenth/helper/_moderator.py +125 -0
- Ryzenth/helper/_openai.py +10 -4
- Ryzenth/helper/_thinking.py +66 -0
- {ryzenth-1.8.8.dist-info → ryzenth-1.8.9.dist-info}/METADATA +1 -1
- ryzenth-1.8.9.dist-info/RECORD +18 -0
- {ryzenth-1.8.8.dist-info → ryzenth-1.8.9.dist-info}/WHEEL +1 -1
- ryzenth-1.8.8.dist-info/RECORD +0 -13
- {ryzenth-1.8.8.dist-info → ryzenth-1.8.9.dist-info}/licenses/LICENSE +0 -0
- {ryzenth-1.8.8.dist-info → ryzenth-1.8.9.dist-info}/top_level.txt +0 -0
Ryzenth/__version__.py
CHANGED
Ryzenth/_asynchisded.py
CHANGED
@@ -22,7 +22,8 @@ import logging
|
|
22
22
|
import httpx
|
23
23
|
from box import Box
|
24
24
|
|
25
|
-
from Ryzenth.
|
25
|
+
from Ryzenth._errors import WhatFuckError
|
26
|
+
from Ryzenth.helper import FbanAsync, ImagesAsync, ModeratorAsync, WhatAsync, WhisperAsync
|
26
27
|
from Ryzenth.types import DownloaderBy, QueryParameter
|
27
28
|
|
28
29
|
LOGS = logging.getLogger("[Ryzenth] async")
|
@@ -32,41 +33,14 @@ class RyzenthXAsync:
|
|
32
33
|
self.api_key = api_key
|
33
34
|
self.base_url = base_url.rstrip("/")
|
34
35
|
self.headers = {"x-api-key": self.api_key}
|
35
|
-
self.
|
36
|
-
self.
|
36
|
+
self.timeout = 10
|
37
|
+
self.images = ImagesAsync(self)
|
38
|
+
self.what = WhatAsync(self)
|
37
39
|
self.openai_audio = WhisperAsync(self)
|
40
|
+
self.federation = FbanAsync(self)
|
41
|
+
self.moderator = ModeratorAsync(self)
|
38
42
|
self.obj = Box
|
39
43
|
|
40
|
-
class WhatAsync:
|
41
|
-
def __init__(self, parent):
|
42
|
-
self.parent = parent
|
43
|
-
|
44
|
-
async def think(self, params: QueryParameter, dot_access=False):
|
45
|
-
url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
|
46
|
-
async with httpx.AsyncClient() as client:
|
47
|
-
try:
|
48
|
-
response = await client.get(url, params=params.dict(), headers=self.parent.headers, timeout=30)
|
49
|
-
response.raise_for_status()
|
50
|
-
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
51
|
-
except httpx.HTTPError as e:
|
52
|
-
LOGS.error(f"[ASYNC] Error: {str(e)}")
|
53
|
-
return None
|
54
|
-
|
55
|
-
class ImagesAsync:
|
56
|
-
def __init__(self, parent):
|
57
|
-
self.parent = parent
|
58
|
-
|
59
|
-
async def generate(self, params: QueryParameter):
|
60
|
-
url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
|
61
|
-
async with httpx.AsyncClient() as client:
|
62
|
-
try:
|
63
|
-
response = await client.get(url, params=params.dict(), headers=self.parent.headers, timeout=30)
|
64
|
-
response.raise_for_status()
|
65
|
-
return response.content
|
66
|
-
except httpx.HTTPError as e:
|
67
|
-
LOGS.error(f"[ASYNC] Error: {str(e)}")
|
68
|
-
return None
|
69
|
-
|
70
44
|
async def send_downloader(
|
71
45
|
self,
|
72
46
|
switch_name: str = None,
|
@@ -105,13 +79,13 @@ class RyzenthXAsync:
|
|
105
79
|
f"{self.base_url}/v1/dl/{model_name}",
|
106
80
|
params=params.dict(),
|
107
81
|
headers=self.headers,
|
108
|
-
timeout=
|
82
|
+
timeout=self.timeout
|
109
83
|
)
|
110
84
|
response.raise_for_status()
|
111
85
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
112
86
|
except httpx.HTTPError as e:
|
113
87
|
LOGS.error(f"[ASYNC] Error: {str(e)}")
|
114
|
-
|
88
|
+
raise WhatFuckError("[ASYNC] Error fetching") from e
|
115
89
|
|
116
90
|
async def send_message(
|
117
91
|
self,
|
@@ -148,10 +122,10 @@ class RyzenthXAsync:
|
|
148
122
|
f"{self.base_url}/v1/ai/akenox/{model_param}",
|
149
123
|
params=params.dict(),
|
150
124
|
headers=self.headers,
|
151
|
-
timeout=
|
125
|
+
timeout=self.timeout
|
152
126
|
)
|
153
127
|
response.raise_for_status()
|
154
128
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
155
129
|
except httpx.HTTPError as e:
|
156
130
|
LOGS.error(f"[ASYNC] Error: {str(e)}")
|
157
|
-
|
131
|
+
raise WhatFuckError("[ASYNC] Error fetching") from e
|
Ryzenth/_errors.py
ADDED
Ryzenth/_synchisded.py
CHANGED
@@ -22,7 +22,8 @@ import logging
|
|
22
22
|
import httpx
|
23
23
|
from box import Box
|
24
24
|
|
25
|
-
from Ryzenth.
|
25
|
+
from Ryzenth._errors import WhatFuckError
|
26
|
+
from Ryzenth.helper import FbanSync, ImagesSync, ModeratorSync, WhatSync, WhisperSync
|
26
27
|
from Ryzenth.types import DownloaderBy, QueryParameter
|
27
28
|
|
28
29
|
LOGS = logging.getLogger("[Ryzenth] sync")
|
@@ -32,49 +33,14 @@ class RyzenthXSync:
|
|
32
33
|
self.api_key = api_key
|
33
34
|
self.base_url = base_url.rstrip("/")
|
34
35
|
self.headers = {"x-api-key": self.api_key}
|
35
|
-
self.
|
36
|
-
self.
|
36
|
+
self.timeout = 10
|
37
|
+
self.images = ImagesSync(self)
|
38
|
+
self.what = WhatSync(self)
|
37
39
|
self.openai_audio = WhisperSync(self)
|
40
|
+
self.federation = FbanSync(self)
|
41
|
+
self.moderator = ModeratorSync(self)
|
38
42
|
self.obj = Box
|
39
43
|
|
40
|
-
class WhatSync:
|
41
|
-
def __init__(self, parent):
|
42
|
-
self.parent = parent
|
43
|
-
|
44
|
-
def think(self, params: QueryParameter, dot_access=False):
|
45
|
-
url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
|
46
|
-
try:
|
47
|
-
response = httpx.get(
|
48
|
-
url,
|
49
|
-
params=params.dict(),
|
50
|
-
headers=self.parent.headers,
|
51
|
-
timeout=30
|
52
|
-
)
|
53
|
-
response.raise_for_status()
|
54
|
-
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
55
|
-
except httpx.HTTPError as e:
|
56
|
-
LOGS.error(f"[SYNC] Error fetching from deepseek {e}")
|
57
|
-
return None
|
58
|
-
|
59
|
-
class ImagesSync:
|
60
|
-
def __init__(self, parent):
|
61
|
-
self.parent = parent
|
62
|
-
|
63
|
-
def generate(self, params: QueryParameter):
|
64
|
-
url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
|
65
|
-
try:
|
66
|
-
response = httpx.get(
|
67
|
-
url,
|
68
|
-
params=params.dict(),
|
69
|
-
headers=self.parent.headers,
|
70
|
-
timeout=30
|
71
|
-
)
|
72
|
-
response.raise_for_status()
|
73
|
-
return response.content
|
74
|
-
except httpx.HTTPError as e:
|
75
|
-
LOGS.error(f"[SYNC] Error fetching from images {e}")
|
76
|
-
return None
|
77
|
-
|
78
44
|
def send_downloader(
|
79
45
|
self,
|
80
46
|
switch_name: str = None,
|
@@ -111,13 +77,13 @@ class RyzenthXSync:
|
|
111
77
|
f"{self.base_url}/v1/dl/{model_name}",
|
112
78
|
params=params.dict(),
|
113
79
|
headers=self.headers,
|
114
|
-
timeout=
|
80
|
+
timeout=self.timeout
|
115
81
|
)
|
116
82
|
response.raise_for_status()
|
117
83
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
118
84
|
except httpx.HTTPError as e:
|
119
85
|
LOGS.error(f"[SYNC] Error fetching from downloader {e}")
|
120
|
-
|
86
|
+
raise WhatFuckError("[SYNC] Error fetching from downloader") from e
|
121
87
|
|
122
88
|
def send_message(
|
123
89
|
self,
|
@@ -153,10 +119,10 @@ class RyzenthXSync:
|
|
153
119
|
f"{self.base_url}/v1/ai/akenox/{model_param}",
|
154
120
|
params=params.dict(),
|
155
121
|
headers=self.headers,
|
156
|
-
timeout=
|
122
|
+
timeout=self.timeout
|
157
123
|
)
|
158
124
|
response.raise_for_status()
|
159
125
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
160
126
|
except httpx.HTTPError as e:
|
161
127
|
LOGS.error(f"[SYNC] Error fetching from akenox: {e}")
|
162
|
-
|
128
|
+
raise WhatFuckError("[SYNC] Error fetching from akenox") from e
|
Ryzenth/helper/__init__.py
CHANGED
@@ -17,9 +17,21 @@
|
|
17
17
|
# You should have received a copy of the GNU Affero General Public License
|
18
18
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
19
19
|
|
20
|
+
from ._federation import FbanAsync, FbanSync
|
21
|
+
from ._images import ImagesAsync, ImagesSync
|
22
|
+
from ._moderator import ModeratorAsync, ModeratorSync
|
20
23
|
from ._openai import WhisperAsync, WhisperSync
|
24
|
+
from ._thinking import WhatAsync, WhatSync
|
21
25
|
|
22
26
|
__all__ = [
|
23
27
|
"WhisperAsync",
|
24
|
-
"WhisperSync"
|
28
|
+
"WhisperSync",
|
29
|
+
"ImagesAsync",
|
30
|
+
"ImagesSync",
|
31
|
+
"WhatAsync",
|
32
|
+
"WhatSync",
|
33
|
+
"FbanAsync",
|
34
|
+
"FbanSync",
|
35
|
+
"ModeratorAsync",
|
36
|
+
"ModeratorSync",
|
25
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
|
Ryzenth/helper/_openai.py
CHANGED
@@ -21,6 +21,7 @@ import logging
|
|
21
21
|
|
22
22
|
import httpx
|
23
23
|
|
24
|
+
from Ryzenth._errors import WhatFuckError
|
24
25
|
from Ryzenth.types import OpenaiWhisper
|
25
26
|
|
26
27
|
LOGS = logging.getLogger("[Ryzenth]")
|
@@ -33,12 +34,17 @@ class WhisperAsync:
|
|
33
34
|
url = f"{self.parent.base_url}/v1/ai/openai/whisper-large-v3-turbo"
|
34
35
|
async with httpx.AsyncClient() as client:
|
35
36
|
try:
|
36
|
-
response = await client.get(
|
37
|
+
response = await client.get(
|
38
|
+
url,
|
39
|
+
params=params.dict(),
|
40
|
+
headers=self.parent.headers,
|
41
|
+
timeout=self.parent.timeout
|
42
|
+
)
|
37
43
|
response.raise_for_status()
|
38
44
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
39
45
|
except httpx.HTTPError as e:
|
40
46
|
LOGS.error(f"[ASYNC] Error: {str(e)}")
|
41
|
-
|
47
|
+
raise WhatFuckError("[ASYNC] Error fetching") from e
|
42
48
|
|
43
49
|
class WhisperSync:
|
44
50
|
def __init__(self, parent):
|
@@ -51,10 +57,10 @@ class WhisperSync:
|
|
51
57
|
url,
|
52
58
|
params=params.dict(),
|
53
59
|
headers=self.parent.headers,
|
54
|
-
timeout=
|
60
|
+
timeout=self.parent.timeout
|
55
61
|
)
|
56
62
|
response.raise_for_status()
|
57
63
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
58
64
|
except httpx.HTTPError as e:
|
59
65
|
LOGS.error(f"[SYNC] Error fetching from whisper openai {e}")
|
60
|
-
|
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
|
@@ -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,,
|
ryzenth-1.8.8.dist-info/RECORD
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Ryzenth/__init__.py,sha256=CKayGQJ_ZUZF6OHyL9kCdTah05BUikXKWKXL_raAgo8,937
|
2
|
-
Ryzenth/__version__.py,sha256=WMw0ZhFbEu7caaKIRyF0MQHhrdWDRzwYZgq3FyCRvTw,118
|
3
|
-
Ryzenth/_asynchisded.py,sha256=zt7bV3aieGreQULEwLmuwUt6amYrqht1BRB1dWBPEyA,5891
|
4
|
-
Ryzenth/_client.py,sha256=Y-I1ug8Hf2eF74oDY4eICOTP_nuLXdsDSkyZhpdqZy4,1475
|
5
|
-
Ryzenth/_synchisded.py,sha256=hTRlIsTXltDurPUbhx4a4o6VPOrX2bf-gLMIQYWFhlU,5729
|
6
|
-
Ryzenth/helper/__init__.py,sha256=7EyYKljsMHWs7mkj7_zhPuOxo3evXS513tLbW2oezkI,918
|
7
|
-
Ryzenth/helper/_openai.py,sha256=p79Ed_IMHeW69KCVxOiEB80h9fBzNLXXEeghkrphL8w,2299
|
8
|
-
Ryzenth/types/__init__.py,sha256=3eEOjoRcEPoE5J5oIhXEPH6vbYG7TLasTHFcbWGS-mU,1095
|
9
|
-
ryzenth-1.8.8.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
|
10
|
-
ryzenth-1.8.8.dist-info/METADATA,sha256=OsHC_PluVNRpNgngga__8XtAvnafun9wNs4EuZQCrJQ,4181
|
11
|
-
ryzenth-1.8.8.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
12
|
-
ryzenth-1.8.8.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
|
13
|
-
ryzenth-1.8.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|