Ryzenth 1.9.5__py3-none-any.whl → 1.9.8__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/__init__.py +2 -2
- Ryzenth/__version__.py +1 -1
- Ryzenth/_asynchisded.py +13 -3
- Ryzenth/_client.py +12 -3
- Ryzenth/_errors.py +5 -1
- Ryzenth/_synchisded.py +25 -6
- Ryzenth/helper/__init__.py +3 -0
- Ryzenth/helper/_decorators.py +1 -1
- Ryzenth/helper/_federation.py +55 -60
- Ryzenth/helper/_fonts.py +6 -11
- Ryzenth/helper/_images.py +6 -11
- Ryzenth/helper/_moderator.py +12 -17
- Ryzenth/helper/_openai.py +6 -11
- Ryzenth/helper/_ryzenth.py +69 -0
- Ryzenth/helper/_thinking.py +5 -9
- Ryzenth/pyoraddons/__init__.py +46 -0
- Ryzenth/types/__init__.py +6 -0
- {ryzenth-1.9.5.dist-info → ryzenth-1.9.8.dist-info}/METADATA +4 -5
- ryzenth-1.9.8.dist-info/RECORD +22 -0
- ryzenth-1.9.5.dist-info/RECORD +0 -20
- {ryzenth-1.9.5.dist-info → ryzenth-1.9.8.dist-info}/WHEEL +0 -0
- {ryzenth-1.9.5.dist-info → ryzenth-1.9.8.dist-info}/licenses/LICENSE +0 -0
- {ryzenth-1.9.5.dist-info → ryzenth-1.9.8.dist-info}/top_level.txt +0 -0
Ryzenth/__init__.py
CHANGED
@@ -19,6 +19,6 @@
|
|
19
19
|
|
20
20
|
from . import *
|
21
21
|
from .__version__ import __version__
|
22
|
-
from ._client import ApiKeyFrom, UrHellFrom
|
22
|
+
from ._client import ApiKeyFrom, SmallConvertDot, UrHellFrom
|
23
23
|
|
24
|
-
__all__ = [ "ApiKeyFrom", "UrHellFrom"]
|
24
|
+
__all__ = [ "ApiKeyFrom", "UrHellFrom", "SmallConvertDot"]
|
Ryzenth/__version__.py
CHANGED
Ryzenth/_asynchisded.py
CHANGED
@@ -26,6 +26,7 @@ from ._errors import WhatFuckError
|
|
26
26
|
from .helper import (
|
27
27
|
FbanAsync,
|
28
28
|
FontsAsync,
|
29
|
+
HumanizeAsync,
|
29
30
|
ImagesAsync,
|
30
31
|
ModeratorAsync,
|
31
32
|
WhatAsync,
|
@@ -33,7 +34,6 @@ from .helper import (
|
|
33
34
|
)
|
34
35
|
from .types import DownloaderBy, QueryParameter
|
35
36
|
|
36
|
-
LOGS = logging.getLogger("[Ryzenth] async")
|
37
37
|
|
38
38
|
class RyzenthXAsync:
|
39
39
|
def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
|
@@ -48,7 +48,17 @@ class RyzenthXAsync:
|
|
48
48
|
self.federation = FbanAsync(self)
|
49
49
|
self.moderator = ModeratorAsync(self)
|
50
50
|
self.fonts = FontsAsync(self)
|
51
|
+
self.humanizer = HumanizeAsync(self)
|
51
52
|
self.obj = Box
|
53
|
+
self.httpx = httpx
|
54
|
+
self.logger = logging.getLogger("Ryzenth Bot")
|
55
|
+
self.logger.setLevel(logging.INFO)
|
56
|
+
logging.getLogger('httpx').setLevel(logging.WARNING)
|
57
|
+
logging.getLogger('httpcore').setLevel(logging.WARNING)
|
58
|
+
if not self.logger.handlers:
|
59
|
+
handler = logging.FileHandler("RyzenthLib.log", encoding="utf-8")
|
60
|
+
handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s"))
|
61
|
+
self.logger.addHandler(handler)
|
52
62
|
|
53
63
|
async def send_downloader(
|
54
64
|
self,
|
@@ -93,7 +103,7 @@ class RyzenthXAsync:
|
|
93
103
|
response.raise_for_status()
|
94
104
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
95
105
|
except httpx.HTTPError as e:
|
96
|
-
|
106
|
+
self.logger.error(f"[ASYNC] Error: {str(e)}")
|
97
107
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
98
108
|
|
99
109
|
async def send_message(
|
@@ -136,5 +146,5 @@ class RyzenthXAsync:
|
|
136
146
|
response.raise_for_status()
|
137
147
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
138
148
|
except httpx.HTTPError as e:
|
139
|
-
|
149
|
+
self.logger.error(f"[ASYNC] Error: {str(e)}")
|
140
150
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
Ryzenth/_client.py
CHANGED
@@ -19,22 +19,24 @@
|
|
19
19
|
|
20
20
|
import os
|
21
21
|
|
22
|
+
from box import Box
|
23
|
+
|
22
24
|
from ._asynchisded import RyzenthXAsync
|
23
25
|
from ._synchisded import RyzenthXSync
|
24
26
|
from .helper import Decorators
|
25
27
|
|
26
28
|
|
27
29
|
class ApiKeyFrom:
|
28
|
-
def __init__(self, api_key: str = None,
|
30
|
+
def __init__(self, api_key: str = None, is_ok=False):
|
29
31
|
if api_key is Ellipsis:
|
30
|
-
|
32
|
+
is_ok = True
|
31
33
|
api_key = None
|
32
34
|
|
33
35
|
if not api_key:
|
34
36
|
api_key = os.environ.get("RYZENTH_API_KEY")
|
35
37
|
|
36
38
|
if not api_key:
|
37
|
-
api_key = "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC" if
|
39
|
+
api_key = "akeno_UKQEQMt991kh2Ehh7JqJYKapx8CCyeC" if is_ok else None
|
38
40
|
|
39
41
|
self.api_key = api_key
|
40
42
|
self.aio = RyzenthXAsync(api_key)
|
@@ -50,3 +52,10 @@ class UrHellFrom:
|
|
50
52
|
|
51
53
|
def something(self):
|
52
54
|
pass
|
55
|
+
|
56
|
+
class SmallConvertDot:
|
57
|
+
def __init__(self, obj):
|
58
|
+
self.obj = obj
|
59
|
+
|
60
|
+
def to_dot(self):
|
61
|
+
return Box(self.obj if self.obj is not None else {})
|
Ryzenth/_errors.py
CHANGED
@@ -26,6 +26,9 @@ class WhatFuckError(Exception):
|
|
26
26
|
class ParamsRequiredError(ValueError):
|
27
27
|
pass
|
28
28
|
|
29
|
+
class UnauthorizedAccessError(ValueError):
|
30
|
+
pass
|
31
|
+
|
29
32
|
class InvalidVersionError(ValueError):
|
30
33
|
pass
|
31
34
|
|
@@ -40,5 +43,6 @@ __all__ = [
|
|
40
43
|
"ParamsRequiredError",
|
41
44
|
"InvalidVersionError",
|
42
45
|
"InvalidJSONDecodeError",
|
43
|
-
"InvalidEmptyError"
|
46
|
+
"InvalidEmptyError",
|
47
|
+
"UnauthorizedAccessError"
|
44
48
|
]
|
Ryzenth/_synchisded.py
CHANGED
@@ -22,11 +22,18 @@ import logging
|
|
22
22
|
import httpx
|
23
23
|
from box import Box
|
24
24
|
|
25
|
-
from
|
26
|
-
from
|
27
|
-
|
25
|
+
from ._errors import WhatFuckError
|
26
|
+
from .helper import (
|
27
|
+
FbanSync,
|
28
|
+
FontsSync,
|
29
|
+
HumanizeSync,
|
30
|
+
ImagesSync,
|
31
|
+
ModeratorSync,
|
32
|
+
WhatSync,
|
33
|
+
WhisperSync,
|
34
|
+
)
|
35
|
+
from .types import DownloaderBy, QueryParameter
|
28
36
|
|
29
|
-
LOGS = logging.getLogger("[Ryzenth] sync")
|
30
37
|
|
31
38
|
class RyzenthXSync:
|
32
39
|
def __init__(self, api_key: str, base_url: str = "https://randydev-ryu-js.hf.space/api"):
|
@@ -41,7 +48,19 @@ class RyzenthXSync:
|
|
41
48
|
self.federation = FbanSync(self)
|
42
49
|
self.moderator = ModeratorSync(self)
|
43
50
|
self.fonts = FontsSync(self)
|
51
|
+
self.humanizer = HumanizeSync(self)
|
44
52
|
self.obj = Box
|
53
|
+
self.httpx = httpx
|
54
|
+
self.logger = logging.getLogger("Ryzenth Bot")
|
55
|
+
self.logger.setLevel(logging.INFO)
|
56
|
+
logging.getLogger('httpx').setLevel(logging.WARNING)
|
57
|
+
logging.getLogger('httpcore').setLevel(logging.WARNING)
|
58
|
+
if not self.logger.handlers:
|
59
|
+
handler = logging.FileHandler("RyzenthLib.log", encoding="utf-8")
|
60
|
+
handler.setFormatter(logging.Formatter("%(asctime)s - %(levelname)s - %(message)s"))
|
61
|
+
self.logger.addHandler(handler)
|
62
|
+
|
63
|
+
|
45
64
|
|
46
65
|
def send_downloader(
|
47
66
|
self,
|
@@ -84,7 +103,7 @@ class RyzenthXSync:
|
|
84
103
|
response.raise_for_status()
|
85
104
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
86
105
|
except httpx.HTTPError as e:
|
87
|
-
|
106
|
+
self.logger.error(f"[SYNC] Error fetching from downloader {e}")
|
88
107
|
raise WhatFuckError("[SYNC] Error fetching from downloader") from e
|
89
108
|
|
90
109
|
def send_message(
|
@@ -126,5 +145,5 @@ class RyzenthXSync:
|
|
126
145
|
response.raise_for_status()
|
127
146
|
return self.obj(response.json() or {}) if dot_access else response.json()
|
128
147
|
except httpx.HTTPError as e:
|
129
|
-
|
148
|
+
self.logger.error(f"[SYNC] Error fetching from akenox: {e}")
|
130
149
|
raise WhatFuckError("[SYNC] Error fetching from akenox") from e
|
Ryzenth/helper/__init__.py
CHANGED
@@ -23,6 +23,7 @@ from ._fonts import FontsAsync, FontsSync
|
|
23
23
|
from ._images import ImagesAsync, ImagesSync
|
24
24
|
from ._moderator import ModeratorAsync, ModeratorSync
|
25
25
|
from ._openai import WhisperAsync, WhisperSync
|
26
|
+
from ._ryzenth import HumanizeAsync, HumanizeSync
|
26
27
|
from ._thinking import WhatAsync, WhatSync
|
27
28
|
|
28
29
|
__all__ = [
|
@@ -38,5 +39,7 @@ __all__ = [
|
|
38
39
|
"ModeratorSync",
|
39
40
|
"FontsAsync",
|
40
41
|
"FontsSync",
|
42
|
+
"HumanizeAsync",
|
43
|
+
"HumanizeSync",
|
41
44
|
"Decorators"
|
42
45
|
]
|
Ryzenth/helper/_decorators.py
CHANGED
@@ -24,7 +24,7 @@ from ..types import QueryParameter
|
|
24
24
|
|
25
25
|
class Decorators:
|
26
26
|
def __init__(self, class_func):
|
27
|
-
self._clients_ai = class_func(...,
|
27
|
+
self._clients_ai = class_func(..., is_ok=True)
|
28
28
|
|
29
29
|
def send_ai(self, name: str, only_author=False):
|
30
30
|
def decorator(func):
|
Ryzenth/helper/_federation.py
CHANGED
@@ -17,13 +17,8 @@
|
|
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
|
-
import logging
|
21
|
-
|
22
|
-
import httpx
|
23
|
-
|
24
20
|
from .._errors import WhatFuckError
|
25
21
|
|
26
|
-
LOGS = logging.getLogger("[Ryzenth]")
|
27
22
|
|
28
23
|
class FbanSync:
|
29
24
|
def __init__(self, parent):
|
@@ -32,7 +27,7 @@ class FbanSync:
|
|
32
27
|
def newfed(self, name: str , owner: int, dot_access=False):
|
33
28
|
url = f"{self.parent.base_url}/v2/federation/newfed"
|
34
29
|
try:
|
35
|
-
response = httpx.post(
|
30
|
+
response = self.parent.httpx.post(
|
36
31
|
url,
|
37
32
|
json={"name": name, "owner": owner},
|
38
33
|
headers=self.parent.headers,
|
@@ -40,14 +35,14 @@ class FbanSync:
|
|
40
35
|
)
|
41
36
|
response.raise_for_status()
|
42
37
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
43
|
-
except httpx.HTTPError as e:
|
44
|
-
|
38
|
+
except self.parent.httpx.HTTPError as e:
|
39
|
+
self.parent.logger.error(f"[SYNC] Error fetching from newfed {e}")
|
45
40
|
raise WhatFuckError("[SYNC] Error fetching from newfed") from e
|
46
41
|
|
47
42
|
def subfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
|
48
43
|
url = f"{self.parent.base_url}/v2/federation/subfed"
|
49
44
|
try:
|
50
|
-
response = httpx.post(
|
45
|
+
response = self.parent.httpx.post(
|
51
46
|
url,
|
52
47
|
json={"parent_uuid": parent_uuid, "child_uuid": child_uuid},
|
53
48
|
headers=self.parent.headers,
|
@@ -55,28 +50,28 @@ class FbanSync:
|
|
55
50
|
)
|
56
51
|
response.raise_for_status()
|
57
52
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
58
|
-
except httpx.HTTPError as e:
|
59
|
-
|
53
|
+
except self.parent.httpx.HTTPError as e:
|
54
|
+
self.parent.logger.error(f"[SYNC] Error fetching from subfed {e}")
|
60
55
|
raise WhatFuckError("[SYNC] Error fetching from subfed") from e
|
61
56
|
|
62
57
|
def getfed(self, uuid: str, dot_access=False):
|
63
58
|
url = f"{self.parent.base_url}/v2/federation/getfed/{uuid}"
|
64
59
|
try:
|
65
|
-
response = httpx.get(
|
60
|
+
response = self.parent.httpx.get(
|
66
61
|
url,
|
67
62
|
headers=self.parent.headers,
|
68
63
|
timeout=self.parent.timeout
|
69
64
|
)
|
70
65
|
response.raise_for_status()
|
71
66
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
72
|
-
except httpx.HTTPError as e:
|
73
|
-
|
67
|
+
except self.parent.httpx.HTTPError as e:
|
68
|
+
self.parent.logger.error(f"[SYNC] Error fetching from getfed {e}")
|
74
69
|
raise WhatFuckError("[SYNC] Error fetching from getfed") from e
|
75
70
|
|
76
71
|
def unban(self, name: str, user_id: int, dot_access=False):
|
77
72
|
url = f"{self.parent.base_url}/v2/federation/unban"
|
78
73
|
try:
|
79
|
-
response = httpx.post(
|
74
|
+
response = self.parent.httpx.post(
|
80
75
|
url,
|
81
76
|
json={"name": name, "user_id": user_id},
|
82
77
|
headers=self.parent.headers,
|
@@ -84,14 +79,14 @@ class FbanSync:
|
|
84
79
|
)
|
85
80
|
response.raise_for_status()
|
86
81
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
87
|
-
except httpx.HTTPError as e:
|
88
|
-
|
82
|
+
except self.parent.httpx.HTTPError as e:
|
83
|
+
self.parent.logger.error(f"[SYNC] Error fetching from unban {e}")
|
89
84
|
raise WhatFuckError("[SYNC] Error fetching from unban") from e
|
90
85
|
|
91
86
|
def ban(self, federation_uuid: str, user_id: int, dot_access=False):
|
92
87
|
url = f"{self.parent.base_url}/v2/federation/ban"
|
93
88
|
try:
|
94
|
-
response = httpx.post(
|
89
|
+
response = self.parent.httpx.post(
|
95
90
|
url,
|
96
91
|
json={"federation_uuid": federation_uuid, "user_id": user_id},
|
97
92
|
headers=self.parent.headers,
|
@@ -99,14 +94,14 @@ class FbanSync:
|
|
99
94
|
)
|
100
95
|
response.raise_for_status()
|
101
96
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
102
|
-
except httpx.HTTPError as e:
|
103
|
-
|
104
|
-
raise WhatFuckError("[SYNC] Error fetching from
|
97
|
+
except self.parent.httpx.HTTPError as e:
|
98
|
+
self.parent.logger.error(f"[SYNC] Error fetching from ban {e}")
|
99
|
+
raise WhatFuckError("[SYNC] Error fetching from ban") from e
|
105
100
|
|
106
101
|
def ban_check(self, federation_uuid: str, user_id: int, dot_access=False):
|
107
102
|
url = f"{self.parent.base_url}/v2/federation/ban-check"
|
108
103
|
try:
|
109
|
-
response = httpx.post(
|
104
|
+
response = self.parent.httpx.post(
|
110
105
|
url,
|
111
106
|
json={"federation_uuid": federation_uuid, "user_id": user_id},
|
112
107
|
headers=self.parent.headers,
|
@@ -114,14 +109,14 @@ class FbanSync:
|
|
114
109
|
)
|
115
110
|
response.raise_for_status()
|
116
111
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
117
|
-
except httpx.HTTPError as e:
|
118
|
-
|
112
|
+
except self.parent.httpx.HTTPError as e:
|
113
|
+
self.parent.logger.error(f"[SYNC] Error fetching from ban-check {e}")
|
119
114
|
raise WhatFuckError("[SYNC] Error fetching from ban-check") from e
|
120
115
|
|
121
116
|
def fedstats(self, uuid: str, dot_access=False):
|
122
117
|
url = f"{self.parent.base_url}/v2/federation/fedstats"
|
123
118
|
try:
|
124
|
-
response = httpx.get(
|
119
|
+
response = self.parent.httpx.get(
|
125
120
|
url,
|
126
121
|
params={"uuid": uuid},
|
127
122
|
headers=self.parent.headers,
|
@@ -129,14 +124,14 @@ class FbanSync:
|
|
129
124
|
)
|
130
125
|
response.raise_for_status()
|
131
126
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
132
|
-
except httpx.HTTPError as e:
|
133
|
-
|
127
|
+
except self.parent.httpx.HTTPError as e:
|
128
|
+
self.parent.logger.error(f"[SYNC] Error fetching from fedstats {e}")
|
134
129
|
raise WhatFuckError("[SYNC] Error fetching from fedstats") from e
|
135
130
|
|
136
131
|
def unsubfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
|
137
132
|
url = f"{self.parent.base_url}/v2/federation/unsubfed"
|
138
133
|
try:
|
139
|
-
response = httpx.post(
|
134
|
+
response = self.parent.httpx.post(
|
140
135
|
url,
|
141
136
|
json={"parent_uuid": parent_uuid, "child_uuid": child_uuid},
|
142
137
|
headers=self.parent.headers,
|
@@ -144,14 +139,14 @@ class FbanSync:
|
|
144
139
|
)
|
145
140
|
response.raise_for_status()
|
146
141
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
147
|
-
except httpx.HTTPError as e:
|
148
|
-
|
142
|
+
except self.parent.httpx.HTTPError as e:
|
143
|
+
self.parent.logger.error(f"[SYNC] Error fetching from unsubfed {e}")
|
149
144
|
raise WhatFuckError("[SYNC] Error fetching from unsubfed") from e
|
150
145
|
|
151
146
|
def renamefed(self, federation_uuid: str, new_name: str, dot_access=False):
|
152
147
|
url = f"{self.parent.base_url}/v2/federation/renamefed"
|
153
148
|
try:
|
154
|
-
response = httpx.post(
|
149
|
+
response = self.parent.httpx.post(
|
155
150
|
url,
|
156
151
|
json={"federation_uuid": federation_uuid, "new_name": new_name},
|
157
152
|
headers=self.parent.headers,
|
@@ -159,8 +154,8 @@ class FbanSync:
|
|
159
154
|
)
|
160
155
|
response.raise_for_status()
|
161
156
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
162
|
-
except httpx.HTTPError as e:
|
163
|
-
|
157
|
+
except self.parent.httpx.HTTPError as e:
|
158
|
+
self.parent.logger.error(f"[SYNC] Error fetching from renamefed {e}")
|
164
159
|
raise WhatFuckError("[SYNC] Error fetching from renamefed") from e
|
165
160
|
|
166
161
|
class FbanAsync:
|
@@ -169,7 +164,7 @@ class FbanAsync:
|
|
169
164
|
|
170
165
|
async def newfed(self, name: str , owner: int, dot_access=False):
|
171
166
|
url = f"{self.parent.base_url}/v2/federation/newfed"
|
172
|
-
async with httpx.AsyncClient() as client:
|
167
|
+
async with self.parent.httpx.AsyncClient() as client:
|
173
168
|
try:
|
174
169
|
response = await client.post(
|
175
170
|
url,
|
@@ -179,13 +174,13 @@ class FbanAsync:
|
|
179
174
|
)
|
180
175
|
response.raise_for_status()
|
181
176
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
182
|
-
except httpx.HTTPError as e:
|
183
|
-
|
177
|
+
except self.parent.httpx.HTTPError as e:
|
178
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
184
179
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
185
180
|
|
186
181
|
async def subfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
|
187
182
|
url = f"{self.parent.base_url}/v2/federation/subfed"
|
188
|
-
async with httpx.AsyncClient() as client:
|
183
|
+
async with self.parent.httpx.AsyncClient() as client:
|
189
184
|
try:
|
190
185
|
response = await client.post(
|
191
186
|
url,
|
@@ -195,24 +190,24 @@ class FbanAsync:
|
|
195
190
|
)
|
196
191
|
response.raise_for_status()
|
197
192
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
198
|
-
except httpx.HTTPError as e:
|
199
|
-
|
193
|
+
except self.parent.httpx.HTTPError as e:
|
194
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
200
195
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
201
196
|
|
202
197
|
async def getfed(self, uuid: str, dot_access=False):
|
203
198
|
url = f"{self.parent.base_url}/v2/federation/getfed/{uuid}"
|
204
|
-
async with httpx.AsyncClient() as client:
|
199
|
+
async with self.parent.httpx.AsyncClient() as client:
|
205
200
|
try:
|
206
201
|
response = await client.get(url, headers=self.parent.headers, timeout=self.parent.timeout)
|
207
202
|
response.raise_for_status()
|
208
203
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
209
|
-
except httpx.HTTPError as e:
|
210
|
-
|
204
|
+
except self.parent.httpx.HTTPError as e:
|
205
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
211
206
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
212
207
|
|
213
208
|
async def unban(self, name: str, user_id: int, dot_access=False):
|
214
209
|
url = f"{self.parent.base_url}/v2/federation/unban"
|
215
|
-
async with httpx.AsyncClient() as client:
|
210
|
+
async with self.parent.httpx.AsyncClient() as client:
|
216
211
|
try:
|
217
212
|
response = await client.post(
|
218
213
|
url,
|
@@ -222,13 +217,13 @@ class FbanAsync:
|
|
222
217
|
)
|
223
218
|
response.raise_for_status()
|
224
219
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
225
|
-
except httpx.HTTPError as e:
|
226
|
-
|
220
|
+
except self.parent.httpx.HTTPError as e:
|
221
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
227
222
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
228
223
|
|
229
224
|
async def ban(self, federation_uuid: str, user_id: int, dot_access=False):
|
230
225
|
url = f"{self.parent.base_url}/v2/federation/ban"
|
231
|
-
async with httpx.AsyncClient() as client:
|
226
|
+
async with self.parent.httpx.AsyncClient() as client:
|
232
227
|
try:
|
233
228
|
response = await client.post(
|
234
229
|
url,
|
@@ -238,13 +233,13 @@ class FbanAsync:
|
|
238
233
|
)
|
239
234
|
response.raise_for_status()
|
240
235
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
241
|
-
except httpx.HTTPError as e:
|
242
|
-
|
236
|
+
except self.parent.httpx.HTTPError as e:
|
237
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
243
238
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
244
239
|
|
245
240
|
async def ban_check(self, federation_uuid: str, user_id: int, dot_access=False):
|
246
241
|
url = f"{self.parent.base_url}/v2/federation/ban-check"
|
247
|
-
async with httpx.AsyncClient() as client:
|
242
|
+
async with self.parent.httpx.AsyncClient() as client:
|
248
243
|
try:
|
249
244
|
response = await client.post(
|
250
245
|
url,
|
@@ -254,13 +249,13 @@ class FbanAsync:
|
|
254
249
|
)
|
255
250
|
response.raise_for_status()
|
256
251
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
257
|
-
except httpx.HTTPError as e:
|
258
|
-
|
252
|
+
except self.parent.httpx.HTTPError as e:
|
253
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
259
254
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
260
255
|
|
261
256
|
async def fedstats(self, uuid: str, dot_access=False):
|
262
257
|
url = f"{self.parent.base_url}/v2/federation/fedstats"
|
263
|
-
async with httpx.AsyncClient() as client:
|
258
|
+
async with self.parent.httpx.AsyncClient() as client:
|
264
259
|
try:
|
265
260
|
response = await client.get(
|
266
261
|
url,
|
@@ -270,13 +265,13 @@ class FbanAsync:
|
|
270
265
|
)
|
271
266
|
response.raise_for_status()
|
272
267
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
273
|
-
except httpx.HTTPError as e:
|
274
|
-
|
268
|
+
except self.parent.httpx.HTTPError as e:
|
269
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
275
270
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
276
271
|
|
277
272
|
async def unsubfed(self, parent_uuid: str, child_uuid: str, dot_access=False):
|
278
273
|
url = f"{self.parent.base_url}/v2/federation/unsubfed"
|
279
|
-
async with httpx.AsyncClient() as client:
|
274
|
+
async with self.parent.httpx.AsyncClient() as client:
|
280
275
|
try:
|
281
276
|
response = await client.post(
|
282
277
|
url,
|
@@ -286,13 +281,13 @@ class FbanAsync:
|
|
286
281
|
)
|
287
282
|
response.raise_for_status()
|
288
283
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
289
|
-
except httpx.HTTPError as e:
|
290
|
-
|
284
|
+
except self.parent.httpx.HTTPError as e:
|
285
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
291
286
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
292
287
|
|
293
288
|
async def renamefed(self, federation_uuid: str, new_name: str, dot_access=False):
|
294
289
|
url = f"{self.parent.base_url}/v2/federation/renamefed"
|
295
|
-
async with httpx.AsyncClient() as client:
|
290
|
+
async with self.parent.httpx.AsyncClient() as client:
|
296
291
|
try:
|
297
292
|
response = await client.post(
|
298
293
|
url,
|
@@ -302,6 +297,6 @@ class FbanAsync:
|
|
302
297
|
)
|
303
298
|
response.raise_for_status()
|
304
299
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
305
|
-
except httpx.HTTPError as e:
|
306
|
-
|
300
|
+
except self.parent.httpx.HTTPError as e:
|
301
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
307
302
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
Ryzenth/helper/_fonts.py
CHANGED
@@ -17,13 +17,8 @@
|
|
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
|
-
import logging
|
21
|
-
|
22
|
-
import httpx
|
23
|
-
|
24
20
|
from .._errors import ParamsRequiredError, WhatFuckError
|
25
21
|
|
26
|
-
LOGS = logging.getLogger("[Ryzenth]")
|
27
22
|
|
28
23
|
class FontsAsync:
|
29
24
|
def __init__(self, parent):
|
@@ -39,7 +34,7 @@ class FontsAsync:
|
|
39
34
|
if not text:
|
40
35
|
raise ParamsRequiredError("Invalid Params Text")
|
41
36
|
_params = self.parent.params if use_parent_params_dict else {"query": text}
|
42
|
-
async with httpx.AsyncClient() as client:
|
37
|
+
async with self.parent.httpx.AsyncClient() as client:
|
43
38
|
try:
|
44
39
|
response = await client.get(
|
45
40
|
url,
|
@@ -49,8 +44,8 @@ class FontsAsync:
|
|
49
44
|
)
|
50
45
|
response.raise_for_status()
|
51
46
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
52
|
-
except httpx.HTTPError as e:
|
53
|
-
|
47
|
+
except self.parent.httpx.HTTPError as e:
|
48
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
54
49
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
55
50
|
|
56
51
|
class FontsSync:
|
@@ -68,7 +63,7 @@ class FontsSync:
|
|
68
63
|
raise ParamsRequiredError("Invalid Params Text")
|
69
64
|
_params = self.parent.params if use_parent_params_dict else {"query": text}
|
70
65
|
try:
|
71
|
-
response = httpx.get(
|
66
|
+
response = self.parent.httpx.get(
|
72
67
|
url,
|
73
68
|
params=_params,
|
74
69
|
headers=self.parent.headers,
|
@@ -76,6 +71,6 @@ class FontsSync:
|
|
76
71
|
)
|
77
72
|
response.raise_for_status()
|
78
73
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
79
|
-
except httpx.HTTPError as e:
|
80
|
-
|
74
|
+
except self.parent.httpx.HTTPError as e:
|
75
|
+
self.parent.logger.error(f"[SYNC] Error fetching from fonts {e}")
|
81
76
|
raise WhatFuckError("[SYNC] Error fetching from fonts") from e
|
Ryzenth/helper/_images.py
CHANGED
@@ -17,14 +17,9 @@
|
|
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
|
-
import logging
|
21
|
-
|
22
|
-
import httpx
|
23
|
-
|
24
20
|
from .._errors import WhatFuckError
|
25
21
|
from ..types import QueryParameter
|
26
22
|
|
27
|
-
LOGS = logging.getLogger("[Ryzenth]")
|
28
23
|
|
29
24
|
class ImagesAsync:
|
30
25
|
def __init__(self, parent):
|
@@ -32,13 +27,13 @@ class ImagesAsync:
|
|
32
27
|
|
33
28
|
async def generate(self, params: QueryParameter):
|
34
29
|
url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
|
35
|
-
async with httpx.AsyncClient() as client:
|
30
|
+
async with self.parent.httpx.AsyncClient() as client:
|
36
31
|
try:
|
37
32
|
response = await client.get(url, params=params.dict(), headers=self.parent.headers, timeout=self.parent.timeout)
|
38
33
|
response.raise_for_status()
|
39
34
|
return response.content
|
40
|
-
except httpx.HTTPError as e:
|
41
|
-
|
35
|
+
except self.parent.httpx.HTTPError as e:
|
36
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
42
37
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
43
38
|
|
44
39
|
class ImagesSync:
|
@@ -48,7 +43,7 @@ class ImagesSync:
|
|
48
43
|
def generate(self, params: QueryParameter):
|
49
44
|
url = f"{self.parent.base_url}/v1/flux/black-forest-labs/flux-1-schnell"
|
50
45
|
try:
|
51
|
-
response = httpx.get(
|
46
|
+
response = self.parent.httpx.get(
|
52
47
|
url,
|
53
48
|
params=params.dict(),
|
54
49
|
headers=self.parent.headers,
|
@@ -56,6 +51,6 @@ class ImagesSync:
|
|
56
51
|
)
|
57
52
|
response.raise_for_status()
|
58
53
|
return response.content
|
59
|
-
except httpx.HTTPError as e:
|
60
|
-
|
54
|
+
except self.parent.httpx.HTTPError as e:
|
55
|
+
self.parent.logger.error(f"[SYNC] Error fetching from images {e}")
|
61
56
|
raise WhatFuckError("[SYNC] Error fetching from images") from e
|
Ryzenth/helper/_moderator.py
CHANGED
@@ -17,13 +17,8 @@
|
|
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
|
-
import logging
|
21
|
-
|
22
|
-
import httpx
|
23
|
-
|
24
20
|
from .._errors import InvalidVersionError, WhatFuckError
|
25
21
|
|
26
|
-
LOGS = logging.getLogger("[Ryzenth]")
|
27
22
|
|
28
23
|
class ModeratorAsync:
|
29
24
|
def __init__(self, parent):
|
@@ -45,7 +40,7 @@ class ModeratorAsync:
|
|
45
40
|
raise InvalidVersionError("Invalid Version V1 or V2")
|
46
41
|
|
47
42
|
url = f"{self.parent.base_url}/v1/ai/akenox/aigen-{_version}"
|
48
|
-
async with httpx.AsyncClient() as client:
|
43
|
+
async with self.parent.httpx.AsyncClient() as client:
|
49
44
|
try:
|
50
45
|
response = await client.get(
|
51
46
|
url,
|
@@ -55,8 +50,8 @@ class ModeratorAsync:
|
|
55
50
|
)
|
56
51
|
response.raise_for_status()
|
57
52
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
58
|
-
except httpx.HTTPError as e:
|
59
|
-
|
53
|
+
except self.parent.httpx.HTTPError as e:
|
54
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
60
55
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
61
56
|
|
62
57
|
async def antievalai(
|
@@ -74,7 +69,7 @@ class ModeratorAsync:
|
|
74
69
|
raise InvalidVersionError("Invalid Version V1 or V2")
|
75
70
|
|
76
71
|
url = f"{self.parent.base_url}/v1/ai/akenox/antievalai-{_version}"
|
77
|
-
async with httpx.AsyncClient() as client:
|
72
|
+
async with self.parent.httpx.AsyncClient() as client:
|
78
73
|
try:
|
79
74
|
response = await client.get(
|
80
75
|
url,
|
@@ -84,8 +79,8 @@ class ModeratorAsync:
|
|
84
79
|
)
|
85
80
|
response.raise_for_status()
|
86
81
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
87
|
-
except httpx.HTTPError as e:
|
88
|
-
|
82
|
+
except self.parent.httpx.HTTPError as e:
|
83
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
89
84
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
90
85
|
|
91
86
|
class ModeratorSync:
|
@@ -109,7 +104,7 @@ class ModeratorSync:
|
|
109
104
|
|
110
105
|
url = f"{self.parent.base_url}/v1/ai/akenox/aigen-{_version}"
|
111
106
|
try:
|
112
|
-
response = httpx.get(
|
107
|
+
response = self.parent.httpx.get(
|
113
108
|
url,
|
114
109
|
params={"query": text, "isJson": is_loads},
|
115
110
|
headers=self.parent.headers,
|
@@ -117,8 +112,8 @@ class ModeratorSync:
|
|
117
112
|
)
|
118
113
|
response.raise_for_status()
|
119
114
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
120
|
-
except httpx.HTTPError as e:
|
121
|
-
|
115
|
+
except self.parent.httpx.HTTPError as e:
|
116
|
+
self.parent.logger.error(f"[SYNC] Error fetching from aigen_image_check {e}")
|
122
117
|
raise WhatFuckError("[SYNC] Error fetching from aigen_image_check") from e
|
123
118
|
|
124
119
|
def antievalai(
|
@@ -137,7 +132,7 @@ class ModeratorSync:
|
|
137
132
|
|
138
133
|
url = f"{self.parent.base_url}/v1/ai/akenox/antievalai-{_version}"
|
139
134
|
try:
|
140
|
-
response = httpx.get(
|
135
|
+
response = self.parent.httpx.get(
|
141
136
|
url,
|
142
137
|
params={"query": text},
|
143
138
|
headers=self.parent.headers,
|
@@ -145,6 +140,6 @@ class ModeratorSync:
|
|
145
140
|
)
|
146
141
|
response.raise_for_status()
|
147
142
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
148
|
-
except httpx.HTTPError as e:
|
149
|
-
|
143
|
+
except self.parent.httpx.HTTPError as e:
|
144
|
+
self.parent.logger.error(f"[SYNC] Error fetching from antievalai {e}")
|
150
145
|
raise WhatFuckError("[SYNC] Error fetching from antievalai") from e
|
Ryzenth/helper/_openai.py
CHANGED
@@ -17,14 +17,9 @@
|
|
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
|
-
import logging
|
21
|
-
|
22
|
-
import httpx
|
23
|
-
|
24
20
|
from .._errors import WhatFuckError
|
25
21
|
from ..types import OpenaiWhisper
|
26
22
|
|
27
|
-
LOGS = logging.getLogger("[Ryzenth]")
|
28
23
|
|
29
24
|
class WhisperAsync:
|
30
25
|
def __init__(self, parent):
|
@@ -32,7 +27,7 @@ class WhisperAsync:
|
|
32
27
|
|
33
28
|
async def whisper_from(self, params: OpenaiWhisper, dot_access=False):
|
34
29
|
url = f"{self.parent.base_url}/v1/ai/openai/whisper-large-v3-turbo"
|
35
|
-
async with httpx.AsyncClient() as client:
|
30
|
+
async with self.parent.httpx.AsyncClient() as client:
|
36
31
|
try:
|
37
32
|
response = await client.get(
|
38
33
|
url,
|
@@ -42,8 +37,8 @@ class WhisperAsync:
|
|
42
37
|
)
|
43
38
|
response.raise_for_status()
|
44
39
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
45
|
-
except httpx.HTTPError as e:
|
46
|
-
|
40
|
+
except self.parent.httpx.HTTPError as e:
|
41
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
47
42
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
48
43
|
|
49
44
|
class WhisperSync:
|
@@ -53,7 +48,7 @@ class WhisperSync:
|
|
53
48
|
def whisper_from(self, params: OpenaiWhisper, dot_access=False):
|
54
49
|
url = f"{self.parent.base_url}/v1/ai/openai/whisper-large-v3-turbo"
|
55
50
|
try:
|
56
|
-
response = httpx.get(
|
51
|
+
response = self.parent.httpx.get(
|
57
52
|
url,
|
58
53
|
params=params.dict(),
|
59
54
|
headers=self.parent.headers,
|
@@ -61,6 +56,6 @@ class WhisperSync:
|
|
61
56
|
)
|
62
57
|
response.raise_for_status()
|
63
58
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
64
|
-
except httpx.HTTPError as e:
|
65
|
-
|
59
|
+
except self.parent.httpx.HTTPError as e:
|
60
|
+
self.parent.logger.error(f"[SYNC] Error fetching from whisper openai {e}")
|
66
61
|
raise WhatFuckError("[SYNC] Error fetching from whisper openai") from e
|
@@ -0,0 +1,69 @@
|
|
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
|
+
|
22
|
+
from .._errors import WhatFuckError
|
23
|
+
from ..types import RequestHumanizer
|
24
|
+
|
25
|
+
|
26
|
+
class HumanizeAsync:
|
27
|
+
def __init__(self, parent):
|
28
|
+
self.parent = parent
|
29
|
+
|
30
|
+
async def rewrite(self, params: RequestHumanizer, pickle_json=False, dot_access=False):
|
31
|
+
url = f"{self.parent.base_url}/v1/ai/r/Ryzenth-Humanize-05-06-2025"
|
32
|
+
async with self.parent.httpx.AsyncClient() as client:
|
33
|
+
try:
|
34
|
+
response = await client.get(
|
35
|
+
url,
|
36
|
+
params=params.dict(),
|
37
|
+
headers=self.parent.headers,
|
38
|
+
timeout=self.parent.timeout
|
39
|
+
)
|
40
|
+
response.raise_for_status()
|
41
|
+
if pickle_json:
|
42
|
+
result = response.json()["results"]
|
43
|
+
return json.loads(result)
|
44
|
+
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
45
|
+
except self.parent.httpx.HTTPError as e:
|
46
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
47
|
+
raise WhatFuckError("[ASYNC] Error fetching") from e
|
48
|
+
|
49
|
+
class HumanizeSync:
|
50
|
+
def __init__(self, parent):
|
51
|
+
self.parent = parent
|
52
|
+
|
53
|
+
def rewrite(self, params: RequestHumanizer, pickle_json=False, dot_access=False):
|
54
|
+
url = f"{self.parent.base_url}/v1/ai/r/Ryzenth-Humanize-05-06-2025"
|
55
|
+
try:
|
56
|
+
response = self.parent.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
|
+
if pickle_json:
|
64
|
+
result = response.json()["results"]
|
65
|
+
return json.loads(result)
|
66
|
+
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
67
|
+
except self.parent.httpx.HTTPError as e:
|
68
|
+
self.parent.logger.error(f"[SYNC] Error fetching from humanize {e}")
|
69
|
+
raise WhatFuckError("[SYNC] Error fetching from humanize") from e
|
Ryzenth/helper/_thinking.py
CHANGED
@@ -17,14 +17,10 @@
|
|
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
|
-
import logging
|
21
|
-
|
22
|
-
import httpx
|
23
20
|
|
24
21
|
from .._errors import WhatFuckError
|
25
22
|
from ..types import QueryParameter
|
26
23
|
|
27
|
-
LOGS = logging.getLogger("[Ryzenth]")
|
28
24
|
|
29
25
|
class WhatAsync:
|
30
26
|
def __init__(self, parent):
|
@@ -32,7 +28,7 @@ class WhatAsync:
|
|
32
28
|
|
33
29
|
async def think(self, params: QueryParameter, dot_access=False):
|
34
30
|
url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
|
35
|
-
async with httpx.AsyncClient() as client:
|
31
|
+
async with self.parent.httpx.AsyncClient() as client:
|
36
32
|
try:
|
37
33
|
response = await client.get(
|
38
34
|
url,
|
@@ -42,8 +38,8 @@ class WhatAsync:
|
|
42
38
|
)
|
43
39
|
response.raise_for_status()
|
44
40
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
45
|
-
except httpx.HTTPError as e:
|
46
|
-
|
41
|
+
except self.parent.httpx.HTTPError as e:
|
42
|
+
self.parent.logger.error(f"[ASYNC] Error: {str(e)}")
|
47
43
|
raise WhatFuckError("[ASYNC] Error fetching") from e
|
48
44
|
|
49
45
|
class WhatSync:
|
@@ -53,7 +49,7 @@ class WhatSync:
|
|
53
49
|
def think(self, params: QueryParameter, dot_access=False):
|
54
50
|
url = f"{self.parent.base_url}/v1/ai/deepseek/deepseek-r1-distill-qwen-32b"
|
55
51
|
try:
|
56
|
-
response = httpx.get(
|
52
|
+
response = self.parent.httpx.get(
|
57
53
|
url,
|
58
54
|
params=params.dict(),
|
59
55
|
headers=self.parent.headers,
|
@@ -62,5 +58,5 @@ class WhatSync:
|
|
62
58
|
response.raise_for_status()
|
63
59
|
return self.parent.obj(response.json() or {}) if dot_access else response.json()
|
64
60
|
except httpx.HTTPError as e:
|
65
|
-
|
61
|
+
self.parent.logger.error(f"[SYNC] Error fetching from deepseek {e}")
|
66
62
|
raise WhatFuckError("[SYNC] Error fetching from deepseek") from e
|
@@ -0,0 +1,46 @@
|
|
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 functools import wraps
|
21
|
+
|
22
|
+
from .._errors import UnauthorizedAccessError
|
23
|
+
|
24
|
+
|
25
|
+
def unauthorized_access(
|
26
|
+
user_list: list = None,
|
27
|
+
author_only: bool = False,
|
28
|
+
member_only: bool = False
|
29
|
+
):
|
30
|
+
"Credits by @xtdevs"
|
31
|
+
def decorator(func):
|
32
|
+
@wraps(func)
|
33
|
+
async def wrapper(client, message):
|
34
|
+
if author_only and message.from_user.id != client.me.id:
|
35
|
+
return await message.reply_text("This Unauthorized Access Only Owner.")
|
36
|
+
if member_only and message.from_user.id not in user_list:
|
37
|
+
return await message.reply_text("This Unauthorized Access Only Members.")
|
38
|
+
return await func(client, message)
|
39
|
+
|
40
|
+
if sum([author_only, member_only]) > 1:
|
41
|
+
raise UnauthorizedAccessError("Only one of author_only, or member_only can be True")
|
42
|
+
|
43
|
+
return wrapper
|
44
|
+
return decorator
|
45
|
+
|
46
|
+
__all__ = ["unauthorized_access"]
|
Ryzenth/types/__init__.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: Ryzenth
|
3
|
-
Version: 1.9.
|
3
|
+
Version: 1.9.8
|
4
4
|
Summary: Ryzenth Python Wrapper For Perfomance
|
5
5
|
Author: TeamKillerX
|
6
6
|
License: MIT
|
@@ -53,15 +53,14 @@ Dynamic: summary
|
|
53
53
|
# Ryzenth Library
|
54
54
|
[](https://github.com/TeamKillerX/Ryzenth)
|
55
55
|
[](https://github.com/TeamKillerX/Ryzenth/graphs/commit-activity)
|
56
|
-
[](https://github.com/TeamKillerX/Ryzenth)
|
57
56
|
[](https://github.com/TeamKillerX/Ryzenth/blob/main/LICENSE)
|
58
57
|
[](https://makeapullrequest.com)
|
59
58
|
[](https://pypi.org/project/Ryzenth)
|
60
59
|
[](https://results.pre-commit.ci/latest/github/TeamKillerX/Ryzenth/main)
|
61
60
|
|
62
|
-
**Ryzenth** is a powerful and flexible Python SDK for interacting with the new **Ryzenth API** a successor to the
|
61
|
+
**Ryzenth** is a powerful and flexible Python SDK for interacting with the new **Ryzenth API V1** a successor to the Ryzenth API V1 supporting both synchronous and asynchronous workflows out of the box.
|
63
62
|
|
64
|
-
> Note:
|
63
|
+
> Note: Ryzenth API V1 (**javascript**) is still alive and supported, but Ryzenth is the next generation.
|
65
64
|
|
66
65
|
## Features
|
67
66
|
|
@@ -126,4 +125,4 @@ export RYZENTH_API_KEY=your-api-key
|
|
126
125
|
|
127
126
|
## License
|
128
127
|
|
129
|
-
|
128
|
+
You can now access the [`Ryzenth API V2 (Typescript)`](https://github.com/xtsea/akenox-ts-dev/blob/main/ryzenth-api.md#-existing-api-still-alive)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Ryzenth/__init__.py,sha256=vM1IVkgRFQT5o15KYKx8kY59114Jw5taP8ytm9YJy94,996
|
2
|
+
Ryzenth/__version__.py,sha256=tnOfM98JgE-ddL33xjRITGFkrdaM2ylCWvNhoJq9y5E,118
|
3
|
+
Ryzenth/_asynchisded.py,sha256=lDNsIIk6KfEUjeqp1xwWJCT1Rbx2LYkEOCrCmq2hTXs,5428
|
4
|
+
Ryzenth/_client.py,sha256=1DhB0Ey-XM8kSpP3ztNkGkrevyLssdFAwLf4mjI6DWU,1867
|
5
|
+
Ryzenth/_errors.py,sha256=cx5BCwFsgUvZPGqHPPRM6S74esjJqIGNAGhBVw1dyYA,1320
|
6
|
+
Ryzenth/_synchisded.py,sha256=39JASRIBKr6mge5T2tMPUI8nbex26xtTtkTu1bcdN14,5251
|
7
|
+
Ryzenth/helper/__init__.py,sha256=BkP6fQ3IJnOqyXn07jD7anumVPlm8lVPNkFnK9b6XpE,1447
|
8
|
+
Ryzenth/helper/_decorators.py,sha256=jmBqzc3wyM8U28z-gf97M-kuBvMLE8laiV7hIqtaVgE,2026
|
9
|
+
Ryzenth/helper/_federation.py,sha256=pfqqGjg179f-olvW1Z7aX1nQf0GQJdSK4NDMaMDxmbA,14552
|
10
|
+
Ryzenth/helper/_fonts.py,sha256=Yy5qWdumGf0Y7tcvEXGLSn87mKlr-x_gmO241a465j8,3035
|
11
|
+
Ryzenth/helper/_images.py,sha256=oOqojWiiYMZja1LloY_c-qIbH-s35yENohpBbZYDHCc,2305
|
12
|
+
Ryzenth/helper/_moderator.py,sha256=Wj5GgFEiGsnDPqB49ho7Loc6QGhqh20FkC0PZWDfgUc,5281
|
13
|
+
Ryzenth/helper/_openai.py,sha256=cbQkEZ_B4NQEnnqG4Wobf_k6HLtKfpeMRJ8vFPuEWUQ,2570
|
14
|
+
Ryzenth/helper/_ryzenth.py,sha256=fI0kUbSN9iZV5VjrFQ2gdUqAG8tQZhiup5bOJi11zTE,2862
|
15
|
+
Ryzenth/helper/_thinking.py,sha256=w_R9iUtEiFib0TG9xfWfv0vljLYd6sWwzaB3nBOUy4w,2542
|
16
|
+
Ryzenth/pyoraddons/__init__.py,sha256=4FK9KTLgJ2ZgyP32UPWbHkHie-s1inTMn7604ojDIA0,1721
|
17
|
+
Ryzenth/types/__init__.py,sha256=5K66BoRKd0yKdIFxph8FwM6Tr8Ha4sbgFctYlAUUQfw,1206
|
18
|
+
ryzenth-1.9.8.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
|
19
|
+
ryzenth-1.9.8.dist-info/METADATA,sha256=XYjLyWEFVJAfK7zv3P9bgh2V0TV9o6IXd-dkJbGWRdg,4093
|
20
|
+
ryzenth-1.9.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
21
|
+
ryzenth-1.9.8.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
|
22
|
+
ryzenth-1.9.8.dist-info/RECORD,,
|
ryzenth-1.9.5.dist-info/RECORD
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Ryzenth/__init__.py,sha256=tju93rICOKAx220Z2aSNLXt0HKVd5vRDfeVzrf49WuY,960
|
2
|
-
Ryzenth/__version__.py,sha256=GZ_mDGvbB3eoVmc5YXLSsgEoUlanzoUvVZoo3RpdJic,118
|
3
|
-
Ryzenth/_asynchisded.py,sha256=B44rz4JD4og3go1ZAcd4R8McxSt9vGo5zIpYtTRY3ms,4888
|
4
|
-
Ryzenth/_client.py,sha256=GLNDmDSq6ROiezaLdi-yo2tCWbgSxgpp1DXduxQHapA,1731
|
5
|
-
Ryzenth/_errors.py,sha256=PYHmA3xZPZnH8T1Yo0Al6ln2FP8KC9Jk3eN631ve2S4,1236
|
6
|
-
Ryzenth/_synchisded.py,sha256=KFO3Smy3qKhOPW9cVQ6uutspDZjiZz79hiLaXFgGRfA,4702
|
7
|
-
Ryzenth/helper/__init__.py,sha256=cFM6wA0fkC-KHkaL4jUK6_3zsm_TKpmz3BaW4HJgFiI,1360
|
8
|
-
Ryzenth/helper/_decorators.py,sha256=W9Y4N_ehmMYStcJJVsQr60WQsqHzON3n5uNuTp9yvGM,2041
|
9
|
-
Ryzenth/helper/_federation.py,sha256=hQ4XIha9j-ohUGmIJyD8HKWMFudBFU0iRLA-12qt_G0,13940
|
10
|
-
Ryzenth/helper/_fonts.py,sha256=i-1OlJwv_bTZL7Wewodajgotij5awSE04CNJyY_SXEs,3027
|
11
|
-
Ryzenth/helper/_images.py,sha256=bsCLycdlheqEc7I5jm_MVzscrNMX1Q_zmFWm3rhchA8,2297
|
12
|
-
Ryzenth/helper/_moderator.py,sha256=p7e1pRUTP8ROmFnRyNWSD5q65CQUKiavgp7yXCstLhk,5197
|
13
|
-
Ryzenth/helper/_openai.py,sha256=-VMH15PJXuYEu0UbwvlIus6NOsB-KNWBTMQvBU16EDU,2562
|
14
|
-
Ryzenth/helper/_thinking.py,sha256=4V2hH0FwegAGhmlO0YlAeXDH3DS4Omihf6m03YJc-SE,2545
|
15
|
-
Ryzenth/types/__init__.py,sha256=3eEOjoRcEPoE5J5oIhXEPH6vbYG7TLasTHFcbWGS-mU,1095
|
16
|
-
ryzenth-1.9.5.dist-info/licenses/LICENSE,sha256=C73aiGSgoCAVNzvAHs-TROaf5vV8yCj9nqpGrmfNHHo,1068
|
17
|
-
ryzenth-1.9.5.dist-info/METADATA,sha256=mU4rv5N9kyLt0KbYr86Dxzu12SUNeUoExz9Czp9miVs,4120
|
18
|
-
ryzenth-1.9.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
19
|
-
ryzenth-1.9.5.dist-info/top_level.txt,sha256=0vIhjOjoQuCxLeZO0of8VCx2jsri-bLHV28nh8wWDnc,8
|
20
|
-
ryzenth-1.9.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|